Ich habe eine Tabelle wie folgt.Mehrere sekundäre Index in Cassandra Leistung in der gleichen Partition
CREATE TABLE posts (
topic text
country text,
bookmarked text,
id uuid,
PRIMARY KEY (topic,id)
);
Danach habe ich sekundären Index für Land erstellt und Lesezeichen wie folgt.
CREATE INDEX posts_country ON posts (country);
CREATE INDEX posts_bookmarked ON posts (bookmarked);
Jetzt Abfrage ich auf einzelne Partition mit Sekundärindex wie folgt.
select * from posts where topic='cassandra' and country='india' and bookmarked='true' allow filtering;
select * from posts where topic='sql' and country='us' and bookmarked='true' allow filtering;
Meine Frage ist, ob alle die Abfrage derselben Partition gehen wird (topic = cassandra oder topic = SQL) dann Filterung alle Zeile oder auf bestimmte Partition abfragen lassen? Und wie wird die Leistung beeinflusst?
Jeder Vorschlag, wie ich mit einem solchen Szenario umgehen kann, wenn es die Leistung beeinträchtigt.
Danke.
Ich habe Follow-up Frage basierend auf Antwort. Wenn sekundäre Index niedrig ist (wie in meinem Fall), und Partition ist klein (~ 200-500 Zeilen), dann wird es auch ineffizient sein? – Darshan
Es wird in Ihrem Fall nicht ineffizient sein. Wie Sie Partitionsschlüssel erwähnt haben und Sie haben diesen großen Datensatz nicht und Sie können es verwenden. – Chaity