Cassandra querying without full primary key As far as I understand there are no secondary indices with multiple columns, only single columns. 

So how do I solve the index problem I'm having? This is my table:

CREATE TABLE IF NOT EXISTS logstv.messages (
    timestamp timestamp,
    channelid bigint,
    userid bigint,
    message text,
    PRIMARY KEY ((channelid, timestamp), userid)
) WITH CLUSTERING ORDER BY (timestamp DESC);


But this is the error currently:
Missing CLUSTERING ORDER for column userid

I want these things:


SELECT WHERE with channelid, userid, timestamp with an order by timestamp and limit
SELECT WHERE with channelid, timestamp with an order by timestamp and limit


Is this possible?

The only option I currently see is setting timestamp as the primary key and then sorting through the rest in my software, which seems very expensive. Or having 2 tables for my data which i want to very much avoid because the data will grow very fast and get big.

Example queries:

SELECT message, timestamp
        FROM logstv.messages 
        WHERE userid = ? 
        AND channelid = ? 
        AND timestamp &gt;= ? 
        AND timestamp &lt;= ?
        ORDER BY timestamp DESC
        LIMIT 100;

SELECT message, timestamp
        FROM logstv.messages 
        WHERE channelid = ? 
        AND timestamp &gt;= ? 
        AND timestamp &lt;= ?
        ORDER BY timestamp DESC
        LIMIT 100;
Yeah, It is possible with 'ALLOW FILTERING' option. BUT NOT ADVISABLE (well explained in this link). Schema design in Cassandra is majorly Query Specific (i.e) design your schema so that it is able to answer a query.
If you want to query on different attributes, go for individual schemas for each one.