3

I have a table with over 18M rows that is growing quickly.

I created a composite index on a datetime column (millions of unique values), intColumn 1 (with about 40k unique values, intColumn 2 (with about 3k unique values) and intColumn 3 (with 1k unique values).

The cardinality of the index ended up being 197!

I am really confused by this and wonder if I did something wrong or is there something I am missing. This index seems useless.

Dan J
  • 16,319
  • 7
  • 50
  • 82

1 Answers1

2

Try running ANALYZE TABLE and then check cardinality. Cardinality shown is just an estimate, and it is probably not correct.

Also, take a look here, it might be of some help.

Community
  • 1
  • 1
Aleksandar Vucetic
  • 14,715
  • 9
  • 53
  • 56