[
https://issues.apache.org/jira/browse/CASSANDRA-3761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13190310#comment-13190310
]
Jawahar Prasad JP edited comment on CASSANDRA-3761 at 1/21/12 5:17 AM:
-----------------------------------------------------------------------
This makes sense.. But can you please point out the difference between these
two? (maybe in terms of performance, etc.,)
1)
CREATE TABLE timeline (
userid uuid,
posted_at date,
body text,
posted_by text,
PRIMARY KEY (user_id, posted_at),
);
SELECT body, posted_by FROM timeline WHERE userid = '...' and posted_at = '2
janvier 2010'
SELECT posted_ad, body, posted_by FROM timeline WHERE userid = '...' and
posted_at > '2 janvier 2010'
2)
CREATE TABLE timeline (
userid uuid PRIMARY KEY,
posted_at date,
body text,
posted_by text
);
CREATE INDEX ON timeline(posted_at);
SELECT body, posted_by FROM timeline WHERE userid = '...' and posted_at = '2
janvier 2010'
SELECT posted_ad, body, posted_by FROM timeline WHERE userid = '...' and
posted_at > '2 janvier 2010'
And also(a dumb question),
If I set PRIMARY KEY (user_id, posted_at) , I MUST ALWAYS filter by userid and
posted_at ?(WHERE userid = '...' and posted_at > '2 janvier 2010')
was (Author: jawahar_prasad):
This makes sense.. But can you please point out the difference between
these two? (maybe in terms of performance, etc.,)
1)
CREATE TABLE timeline (
userid uuid,
posted_at date,
body text,
posted_by text,
PRIMARY KEY (user_id, posted_at),
);
SELECT body, posted_by FROM timeline WHERE userid = '...' and posted_at = '2
janvier 2010'
SELECT posted_ad, body, posted_by FROM timeline WHERE userid = '...' and
posted_at > '2 janvier 2010'
2)
CREATE TABLE timeline (
userid uuid PRIMARY KEY,
posted_at date,
body text,
posted_by text
);
CREATE INDEX ON timeline(posted_at);
SELECT body, posted_by FROM timeline WHERE userid = '...' and posted_at = '2
janvier 2010'
SELECT posted_ad, body, posted_by FROM timeline WHERE userid = '...' and
posted_at > '2 janvier 2010'
And also(a dumb question),
Is it like, I can set PRIMARY KEY (user_id, posted_at) only if i filter by
userid and posted_at ?(WHERE userid = '...' and posted_at > '2 janvier 2010')
> CQL 3.0
> -------
>
> Key: CASSANDRA-3761
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3761
> Project: Cassandra
> Issue Type: New Feature
> Components: API
> Reporter: Sylvain Lebresne
> Labels: cql
> Fix For: 1.1
>
> Attachments: 0001-CQL-3.0.patch,
> 0002-Add-support-for-switching-the-CQL-version.patch,
> 0003-Makes-batches-atomic.patch, 0004-Thrift-gen-files.patch, cql_tests.py,
> create_cf_syntaxes.txt
>
>
> This ticket is a reformulation/generalization of CASSANDRA-2474. The core
> change of CQL 3.0 is to introduce the new syntaxes that were discussed in
> CASSANDRA-2474 that allow to:
> # Provide a better/more native support for wide rows, using the idea of
> transposed vie.
> # The generalization to composite columns.
> The attached text file create_cf_syntaxes.txt recall the new syntaxes
> introduced.
> The changes proposed above allow (and strongly suggest in some cases) a
> number of other changes to the language that this ticket proposes to
> explore/implement (more details coming in the comments).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira