467,887 Members | 1,588 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,887 developers. It's quick & easy.

Order of Where and Composite Key

Suppose I have an index like this:
CREATE INDEX CUSTOMER_NAMES ON CUSTOMER_DATA(LAST_NAME, FIRST_NAME);

Will the execution plan be different if I make a query in the
following forms?

select * from customer where LAST_NAME = 'ABC' and FIRST_NAME = 'DEF'

or

select * from customer where FIRST_NAME = 'DEF' and LAST_NAME = 'ABC'
Thanks

Marcelo

Jul 24 '07 #1
  • viewed: 1623
Share:
1 Reply
mo*******@gmail.com wrote:
Suppose I have an index like this:
CREATE INDEX CUSTOMER_NAMES ON CUSTOMER_DATA(LAST_NAME, FIRST_NAME);

Will the execution plan be different if I make a query in the
following forms?

select * from customer where LAST_NAME = 'ABC' and FIRST_NAME = 'DEF'

or

select * from customer where FIRST_NAME = 'DEF' and LAST_NAME = 'ABC'
No, no difference at all.

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jul 24 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Ismail Rajput | last post: by
13 posts views Thread by Baihao Yuan | last post: by
3 posts views Thread by Eric | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.