All Forums Database
tclear 12 posts Joined 06/12
16 Jan 2014
Index Question

creating a table with item, origin, destination.
what is the best way to index the table when the user may
query by either item/origin or item/destination?

Tags:
pajtasja 4 posts Joined 03/13
16 Jan 2014

Do you mean 'Selecting the Primay Index' column?
 
There's a lot we would need to know to help you and to be accurate, but I would make your PI on Item, knowing almost nothing about your data.  Give it a try, it can't hurt!

Raja_KT 1246 posts Joined 07/09
16 Jan 2014

You can have only one primary index  per table.However, you can create secondary indexes.

So you can design in such a way that they are used in where clause.

 

Cheers,

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

M.Saeed Khurram 544 posts Joined 09/12
17 Jan 2014

Tclear,
You can create PI on Item, and secondary indexes on Item/origin, item/destination to have optimal access.
 

Khurram

sgarlapa 88 posts Joined 03/13
17 Jan 2014

Create the Primary Index with a colum of more unique values.
While creating Secondary index you need to see -
1) how frequently the combination of columns are being used in retrival. if usage is more then only prefer SI.
2) if any utilities such as Fastload, multiload are being used then rethink of creating SI
 
Sri

You must sign in to leave a comment.