Home » RDBMS Server » Performance Tuning » Index
Index [message #280996] Thu, 15 November 2007 06:24 Go to next message
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 #281014 is a reply to message #280996] Thu, 15 November 2007 07:03 Go to previous messageGo to next message
Michel Cadot
Messages: 68726
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
It depends on many things like counts, frequencies, histogram...
And first what does mean "contains"? Does this mean there are conditions on them?

Regards
Michel
Re: Index [message #281017 is a reply to message #281014] Thu, 15 November 2007 07:07 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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
Re: Index [message #281030 is a reply to message #281026] Thu, 15 November 2007 07:35 Go to previous message
Michel Cadot
Messages: 68726
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
How to Identify Performance Problem and Bottleneck

Regards
Michel

Previous Topic: Urgent Please
Next Topic: How to decide on SGA sizing ???
Goto Forum:
  


Current Time: Sat Dec 14 00:01:44 CST 2024