Structure of DB2 database

Now lets talk about databases which is a more interesting topic for developers. If you show up here then you apparently know that databases consist of tables. But there is another slice between them called schema. Schema is just a convenient aggregator of database objects. If your database is bigger than 10 tables then logically separating them into different schemas would probably be beneficial for you.

Next term is view. Using views you can look at your tables from different angle, so to speak. So if you have your table in place and don’t want to change it but it’s more convenient sometimes to use it with different structure from SQL-query then use views.

And a last but not least and probably a most interesting feature is index. Indexes help database to increase performance when searching for data programmer requests. Instead of comparing all fields you indicate in query to find necessary data, database generates indexes for each row in advance, then generate index from query when you run it and compare indexes to find requested data. Basic idea here is to to compare two numbers instead of strings and/or several numbers. It’s just faster.

Advertisements

Tags: , , , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: