aspose file tools*
The moose likes JDBC and the fly likes SQL - Index Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL - Index" Watch "SQL - Index" New topic
Author

SQL - Index

Abder-Rahman Ali
Ranch Hand

Joined: May 22, 2008
Posts: 138
Regarding "Index" in SQL, I searched on the Internet and understood the theoretical part that it is like searching in a library, that instead of searching the whole library for a specific book, by indexing, we can search for the book by its first letter (i.e; Books that begin with the letter "A"), which in this case makes the search much faster.

But, I didn't understand the technical point here.

Say I create an index like this:



What is the preceding line trying to tell me? Maybe the answer will be that I want to search by "coindex", but what is really confusing me is that WHEN will I use indexing. I'm not making any search, so, WHERE can I feel "index" in my SQL command.

Thank you very much.

James Ward
Ranch Hand

Joined: Apr 27, 2003
Posts: 263


In the above SQL, we are searching on coindex column. If an index exists on that column it will be used automatically by database to search, thereby giving us quick results.
Abder-Rahman Ali
Ranch Hand

Joined: May 22, 2008
Posts: 138
James Ward wrote:

In the above SQL, we are searching on coindex column. If an index exists on that column it will be used automatically by database to search, thereby giving us quick results.


Oh, I see, that makes sense.

Thank you so much.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL - Index