0

I have a racesByID table. I also need to find the races by year. What are the pros and cons of using a secondary index on year column over creating a racesByYear table?

1
  • 3
    how many races are there in a year? Secondary indexes are almost never better than creating another table. Unless you have ~50 races a year and a small cluster the racesByYear table will be strictly better. Commented Nov 4, 2019 at 1:14

1 Answer 1

1

It depends on how many race you have per year, Secondary indexes doesn't perform well if you have low or very high carnality, you will have performance issues in those case. for details check this link : https://docs.datastax.com/en/cql/3.3/cql/cql_using/useWhenIndex.html#useWhenIndex__when-no-index

In most cases separates tables will perform better, the cons is that you have to manage the consistency and keep table in sync

I hope this help.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.