Thumb Rule. [message #205039] |
Thu, 23 November 2006 02:23 |
amit_kiran
Messages: 50 Registered: July 2006 Location: UK
|
Member |
|
|
Hi,
Can any one guide me
What is Rule-of-thumb while creating Index ?
Thanks.
|
|
|
Re: Thumb Rule. [message #205046 is a reply to message #205039] |
Thu, 23 November 2006 02:43 |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
A good rule of thumb is that if you put your hand palm down on the table, the Thumb is the bit that sticks out to the side.
Seriously, this has to be a strong contender for 'Vaguest question of the month'
|
|
|
Re: Thumb Rule. [message #205058 is a reply to message #205039] |
Thu, 23 November 2006 03:02 |
amit_kiran
Messages: 50 Registered: July 2006 Location: UK
|
Member |
|
|
Mr JRowbottom,
I thought this site is for New programmers who have problems in their work.
I have not posted my query for your suggestions.
You have no right to comment on my posting.
|
|
|
Re: Thumb Rule. [message #205067 is a reply to message #205058] |
Thu, 23 November 2006 03:54 |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
Quote: | I thought this site is for New programmers who have problems in their work.
| Yes it is, although there is a strong vein in tongue in cheek humour on the board too, in which vein I include my reply.
Quote: | I have not posted my query for your suggestions
|
Actually, I'm pretty sure that you DID post your query here for suggestions.
Quote: | You have no right to comment on my posting.
|
This is a public board, and anyone who wishes to can post comments. If you'd care to provide more detail about your query and reduce the likely size of the required reply to a few paragraphs of text rather than the entire Tuning Reference Manual then you may well get more serious answers.
|
|
|
Re: Thumb Rule. [message #205083 is a reply to message #205067] |
Thu, 23 November 2006 04:50 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
Now now JRowbottom...
You should behave! You should provide the OP with the silver bullet/ rule of thumb for creating index:
start with the keyword "CREATE"
|
|
|
|
|
Re: Thumb Rule. [message #205200 is a reply to message #205179] |
Thu, 23 November 2006 19:55 |
rleishman
Messages: 3728 Registered: October 2005 Location: Melbourne, Australia
|
Senior Member |
|
|
I wouldn't even go that far. There's lots of cases where indexes are no help in joins or searches.
Surely the golden rule is: "If it makes it go better, index it."
|
|
|
Re: Thumb Rule. [message #205275 is a reply to message #205200] |
Fri, 24 November 2006 02:35 |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
As a ROT, I'd say if it's a Primary key, index it.
If it's a foreign key, probably index it.
If it's a combination of columns that occurrs in several queries, consider indexing it.
The problem with ROT is they are so vague that in order to use them wisely, you have to know enough about the subject that you don't need a ROT in the first place.
|
|
|
|
|