Have you considered reading up on basic database management?

There are plenty of good material on the web for you to read where you can actually learn how to manage databases, so you don't have to ask others about every single detail.


Ratheesh K J wrote:
Hello all,

Another question on cardinality.

Consider a table with 1000 rows and  columnns. Details of the columns are as 
below:

FLD_1 - int - cardinality 1000 - PRIMARY KEY

FLD_2 - tinyint- cardinality 400

FLD_3 - varchar - cardinality 10

FLD_4 - varchar - cardinality 2

FLD_5 - varchar - cardinality 5

Assuming that cardinality exactly is the number of distinct values for that 
column, Which are the fields that is best for indexing for the table.

Is it meaningful for me to index FLD_3, FLD_4 and FLD_5 knowing that their 
cardinality is always going to be the same?

There are certain scenarios wherein I have queries on the tables as below:

1) Select * from table where FLD_4 = 1;

2) Select * from table where FLD_5 = 3;

3) Select * from table where FLD_3 >1 AND FLD_5 < 6;

considering all the above cases, what should I conclude? should I have indexes 
on these three fields?


Looking for a specific answer than a "depend on situation" kind of an answer.

Thanks

Ratheesh Bhat K J


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to