Shoutbox

SQL // Database questions - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: SQL // Database questions (/showthread.php?tid=53757)

SQL // Database questions by Wabz on 12-09-2005 at 02:09 PM

At the moment I'm doing databases and SQL  I understand most of what can and can't be done. But one thing really confuses me

How to use indexing.

I understandish how it works by creating unique records with more than just a primary key.

Like you can't use a compisite key to have the same person on the same date going to the same event  (if that makes sense)  as that person could aslo uniquely be sent to a different event on the same day.

But I just can't work out how indexing helps the situation.


RE: SQL // Database questions by RaceProUK on 12-10-2005 at 12:34 AM

Indexing accelerates sorts and searches on indexed columns. There's a small space penalty, as the index does need to be stored, but the speed gains far outweigh the space usage.
It's especially good when joining two tables, as the index makes it trivial to find the right tuple in the entity with the primary key, and join it to the tuple in the entity with the foreign key.