General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Indexes: how is it used in SQL SELECTs?
I have a table called myTable in a database called myData. myTable has a structural (primary) index called ID on field ID, and another (regular) index called LASTNAME on field LASTNAME. In this SQL statememt:
SELECT * FROM myTable WHERE id='0125'
is the ID index automatically used, or do I have to specifically specify that I'd like it to use the ID index?
How about:
SELECT * FROM myTable WHERE id>'0125' ORDER BY LASTNAME :
both ID & LASTNAME index automatically used?
Thanks all!
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only