Cassandra query with index
<p>Imagine I have a table like this:</p>

<pre><code>CREATE TABLE test(
  name  TEXT,
  tag   TEXT,
  id    UUID,
  parameter INT,
  PRIMARY KEY((name, tag, id), parameter)
);
</code></pre>

<p>and an index</p>

<pre><code>CREATE INDEX parameter_idx on test(parameter);
</code></pre>

<p>With a query like this:</p>

<pre><code>SELECT * FROM test WHERE name = 'name' 
                     AND tag = 'tag' 
                     AND parameter = value;
</code></pre>

<p>Is it correct that the index <strong>will</strong> be used, returns many partitions and that these partitions will then be filtered, thus requiring <code>ALLOW FILTERING</code>?</p>

<p>On the contrary a query like this one:</p>

<pre><code>SELECT * FROM test WHERE name = 'name' 
                     AND tag = 'tag' 
                     AND id = some_id,
                     AND parameter = value;
</code></pre>

<p>will not use the index, a single partition will be found and only some rows corresponding to <code>parameter = value</code> will be returned.</p>

<p>Is this all correct?</p>