If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > multiple column index

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-24-06, 04:41
sisharma80 sisharma80 is offline
Registered User
 
Join Date: Aug 2006
Posts: 1
multiple column index

Hi all,

I have a qeury relating to multi column index.

CREATE TABLE EMPLOYEE (ID INT, NAME TEXT);
CREATE INDEX IDX ON EMPLOYEE(ID, NAME);
SELECT * FROM EMPLOYEE WHERE ID > 10 AND NAME < "MAC"

Does the above select statement use index IDX? If yes then how does comparison function evaluates the condition specified in WHERE clause?
Reply With Quote
  #2 (permalink)  
Old 08-24-06, 09:51
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
What database server are you using? SQL Server? Oracle? Something else?
Indexes may be handled differently by different vendors, so post your question in the appropriate forum.
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
  #3 (permalink)  
Old 08-29-06, 01:11
DerekA DerekA is offline
Registered User
 
Join Date: Sep 2002
Location: Sydney, Australia
Posts: 255
sisharma

Indexes are handled differently by each vendor, that's where a significant part of the competitive edge is implemented.

However, indexing a TEXT column is a bit insane, IDX is 100% width (text column size) of the table; variable length and slow. Some vendors cannot index text columns at all. Make the indexed column CHAR(255) or something reasonable.
__________________
Derek Asirvadem
Senior Sybase DBA/Information Architect derekATsoftwaregemsDOTcomDOTau
Anything worth doing is worth doing Right The First Time
Spend your money on standards-compliant development or spend 10 times more fixing it
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On