> Is it possible to get all the data for last 5 seconds or 10 seconds or 30 
> seconds by using the id column?
Not using the current table.

Try this 

CREATE TABLE test1 (
        day                     integer,
        timestamp       integer,
        count           integer, 
        record_name     text,
        record_value    blob,
      PRIMARY KEY (day, timestamp, record_name)
    )

Store the day as YYYYMMDD and the timestamp as before, you can then do queries 
like 

select * from test1 where day = 20131218 and timestamp > X and timestamp < y;

Cheers

-----------------
Aaron Morton
New Zealand
@aaronmorton

Co-Founder & Principal Consultant
Apache Cassandra Consulting
http://www.thelastpickle.com

On 13/12/2013, at 11:28 am, Techy Teck <comptechge...@gmail.com> wrote:

> Below is my CQL table - 
> 
>     CREATE TABLE test1 (
>       id text,
>       record_name text,
>       record_value blob,
>       PRIMARY KEY (id, record_name)
>     )
> 
> here id column will have data like this - 
> 
>     timestamp.count
>     
> And here timestamp is in milliseconds but rounded up to nearest seconds. So 
> as an example, data in `id column` will be like this - 
> 
>     1386882930000.1
>     
> And a single row in the above table will be like this - 
> 
>     1386882930000.1 | event_name | hello-world
>     
> Now my question is - 
> 
> Is it possible to get all the data for last 5 seconds or 10 seconds or 30 
> seconds by using the id column?
> 
> I am running Cassandra 1.2.9

Reply via email to