Home » SQL & PL/SQL » SQL & PL/SQL » Thumb Rule.
Thumb Rule. [message #205039] Thu, 23 November 2006 02:23 Go to next message
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 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 #205086 is a reply to message #205083] Thu, 23 November 2006 04:56 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
But he's not used the secret password yet - how do we know he's allowed to know these things?
You'll be telling him about the _ORACLE_RUNS_FAST hidden parameter next!

Cool
Re: Thumb Rule. [message #205179 is a reply to message #205086] Thu, 23 November 2006 16:46 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Now children, be nice.

I think the rule of thumb for indexes is "If you are going to join on it, or search by it, then index it."

David
Re: Thumb Rule. [message #205200 is a reply to message #205179] Thu, 23 November 2006 19:55 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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.
Re: Thumb Rule. [message #205324 is a reply to message #205039] Fri, 24 November 2006 04:46 Go to previous messageGo to next message
Ferrarist
Messages: 29
Registered: March 2006
Location: Netherlands - Den Haag
Junior Member
Don't even mention loosing your thumb. This would complicate things even more. Laughing
Re: Thumb Rule. [message #205768 is a reply to message #205324] Mon, 27 November 2006 08:25 Go to previous message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
This just goes to show you that the Rule Of Thumb is that there is no rule Of Thumb.
Previous Topic: how to use arrays in PL/SQL
Next Topic: xml convertion
Goto Forum:
  


Current Time: Mon Dec 09 21:24:46 CST 2024