Index [message #280996] |
Thu, 15 November 2007 06:24 |
webadministrator
Messages: 45 Registered: October 2005
|
Member |
|
|
Hello,
i am creating indexes on queries. i have 2 seperate queries but on the same table as follows: the first query contains: code_a, code_b and the second query contains code_b, code_c
my question is: should i create one index that combines all the fileds in both queries or is it better to create to different indexes?
Thank you.
|
|
|
|
Re: Index [message #281017 is a reply to message #281014] |
Thu, 15 November 2007 07:07 |
webadministrator
Messages: 45 Registered: October 2005
|
Member |
|
|
Thank you for your reply.
yes there are conditions. i mean for example
query 1: ... where code_a = 'a' and code_b ='b'
query 2: ... where code_b is null and code_c ='c'
shall i create them all in one index or seperate them?
Thanks
|
|
|
Re: Index [message #281020 is a reply to message #281017] |
Thu, 15 November 2007 07:20 |
|
Michel Cadot
Messages: 68726 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Michel Cadot | It depends on many things like counts, frequencies, histogram...
|
This for the appropriateness of creating indexes and which one.
Do you want an accurate answer or a quick one?
Quickly answer: 2 indexes (code_a, code_b) (or the opposite depending on...) and (code_c, code_b).
Regards
Michel
[Updated on: Thu, 15 November 2007 07:34] Report message to a moderator
|
|
|
Re: Index [message #281026 is a reply to message #280996] |
Thu, 15 November 2007 07:29 |
webadministrator
Messages: 45 Registered: October 2005
|
Member |
|
|
Im sorry i am a bit new to all this index thing.
I would apreciate it if you can give me a small explanation for your answer. is it to enhance the prefomance and speed? and does the order of the fields in the same index count?
thank you
|
|
|
|