Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>No need to copy all data from dynamic column family into static one. </p> <p>Then <strong>How</strong>?? Let me explain you with an example, Suppose you have an CF schema mentioned below:</p> <pre><code>CREATE TABLE sample ( KEY text PRIMARY KEY, flag boolean, name text ) </code></pre> <p><strong>NOTE</strong> I have done indexing on <strong>flag</strong> and <strong>name</strong>.</p> <p>Now here are some data in the CF.</p> <pre><code> KEY,1 | address,Kolkata | flag,True | id,1 | name,Abhijit KEY,2 | address,Kolkata | flag,True | id,2 | name,abc KEY,3 | address,Delhi | flag,True | id,3 | name,xyz KEY,4 | address,Delhi | flag,True | id,4 | name,pqr KEY,5 | address,Delhi | col1,Hi | flag,True | id,4 | name,pqr </code></pre> <p>From the data you can understand that <strong>address</strong>, <strong>id</strong> &amp; <strong>col1</strong> all are dyamically created. </p> <p>Now if i query something like that </p> <pre><code>SELECT * FROM sample WHERE flag =TRUE AND col1='Hi'; </code></pre> <p>Note: col1 is not indexed, but i can filter using that field</p> <p><strong>Output:</strong></p> <pre><code> KEY | address | col1 | flag | id | name -----+---------+------+------+----+------ 5 | Delhi | Hi | True | 4 | pqr </code></pre> <p>Another Query </p> <pre><code> SELECT * FROM sample WHERE flag =TRUE AND id&gt;=1 AND id &lt;5 AND address='Delhi'; </code></pre> <p>Note: Here neither id is indexed, nor the address, still i am getting the output</p> <p><strong>Output:</strong></p> <pre><code> KEY,3 | address,Delhi | flag,True | id,3 | name,xyz KEY,4 | address,Delhi | flag,True | id,4 | name,pqr KEY,5 | address,Delhi | col1,Hi | flag,True | id,4 | name,pqr </code></pre> <p>So basically if you have a column which value is always something you know, and its being indexed. Then you can easily filter on the rest of the dynamic columns aggregating them with indexed always positive column.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload