Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help on selecting Index

 
Nakata kokuyo
Ranch Hand
Posts: 472
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
good day, everyone

if i have a transaction table with fields below :

transaction_no, product_id, product_desc, product_qty, product_txn, transaction_date

can some expert here point out to me , which is the best cluster-index and non-clsuter index ?

and possible kindly please explain why is it so? i'm not good in database so just explain like to beginner

thank you very much for guidance
 
stu derby
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To know the best index(es), you have to know the queries: both the queries themselves and at least a rough idea of their frequency and importance. Otherwise, it's like asking "what data type should I use for my new variable named Green".

In particular, columns that appear frequently in WHERE clauses are often good choices for indexes. However, each index takes space and also slows down every INSERT/UPDATE/DELETE by a tiny bit.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic