By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,514 Members | 1,683 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,514 IT Pros & Developers. It's quick & easy.

Order of Where and Composite Key

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.