3

I have a table named PRODUCT that has 100,000 rows. I was wondering if either indexing, or a hash function on the primary key would result in better performance. I was also hoping someone could explain why either of these would be better.

2
  • 2
    How many fields? How unique is the data? What candidate keys do you have? What's the access pattern - reads only, balanced read/write, many writes/updates?
    – JNK
    Commented May 30, 2012 at 15:28
  • 5
    What's your database? 100K records is not a lot in most cases. Commented May 30, 2012 at 15:33

1 Answer 1

1

With 100k records it shouldn't matter. Even with 100M records it probably won't matter. I've had queries on tables with billions of rows using good old traditional indexes perform just fine.

It's all about how much memory you have and how fast the disks are.

Granted you'll probably get some more specific information if you tell us what database you are using and provide more specifics.

2
  • If apart of considering the memory and disk, which method is better in performance and maintenance ? For example, if new rows need to be inserted...
    – Tomi
    Commented Jun 1, 2012 at 6:34
  • 1
    That will totally depend on the database vendor and how they have implemented these features.
    – mrdenny
    Commented Jun 2, 2012 at 10:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.