|
-
order of index columns
Hi,
I have a table
test (
country varchar2(32),
state varchar2(32),
city varchar2(32),
...
)
Assuming that:
1. 50% rows of test have country value 'USA' while
another 50% are all other countries.
2. My query is something like:
select * from test
where country='USA' and
state='New York' and
city='New York'
I thought I_TEST_2 on TEST(city, state, country) is better than
I_Test_1 on TEST(country, state, city)
But the explain plan shows no difference - query will use
either index if exists.
Can anyone explain why my thought is wrong?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|