Questions tagged [clustering-key]

52 questions
20
votes
1 answer

Cassandra - querying on clustering keys

I am just getting start on Cassandra and I was trying to create tables with different partition and clustering keys to see how they can be queried differently. I created a table with primary key of the form - (a),b,c where a is the partition key and…
user3376961
  • 867
  • 2
  • 12
  • 17
4
votes
1 answer

Cassandra - Sorting data for pagination solution?

So we have a web application using .NET with Cassandra / Spark combo to produce online reports. Currently we grab all relevant data from Cassandra and render it inside a table through a JavaScript plugin that also sorts it (depending on column…
ChiMo
  • 581
  • 2
  • 13
  • 32
4
votes
1 answer

Cassandra modeling with a read/unread status for a message inbox, CQL

I'm trying to find the best data model for a message box application. That messages appear in order in which first the ‘unread’ appear and then as the user scrolls the ‘read’ messages will appear. In both of the categories I want to sort the…
3
votes
1 answer

What's the effect of including an "include" column in a non-clustered index that's already part of the clustering key?

Suppose I cluster a table on (RetailerID, PurchaseDate, UserID). That's the "clustering key", and clustering keys are always included in all non-clustered…
Triynko
  • 18,766
  • 21
  • 107
  • 173
3
votes
1 answer

Changing the Clustering key on an Existing Table - SQL Server 2008

I've been handed a task to improve query performance on a table. The primary key is a GUID that is created by application code, so is not sequential, and there is no separate sequential clustering key on the table. My feeling is that it is the…
MrBliz
  • 5,830
  • 15
  • 57
  • 81
2
votes
1 answer

snowflake show tables with cluster_by

I can use show tables in to show all tables in a database. The results returned show if a table has clustering enabled - shows the cluster_by column. Is there a way to get back a list of all tables that have value in cluster_by ? The…
AlexD
  • 4,062
  • 5
  • 38
  • 65
2
votes
2 answers

Cassandra: Is it okay to use a boolean valued column as a clustering column (as part of the primary key)?

With the Cassandra database system, is it okay to use a boolean valued column as a clustering column (as part of the primary key)? The column will of course not be a partition key, but just one of a bunch of clustering columns. Is it a negative…
PCH
  • 147
  • 5
2
votes
2 answers

cassandra primary key where cause limitation

I want to use cassandra as a DB to store messages, when in my model messages are aggregate by channel. the 3 main important field of message: channel_id created_by message_id (unique) The main read/fetch API is get messages by channel sorted by…
Yoni Homi
  • 21
  • 1
2
votes
1 answer

Snowflake: clustering on datetime key stored in variant field does not work / do partition pruning

We are ingesting data into Snowflake via the kafka connector. To increase the data read performance / scan less partitions we decided to add a clustering key to a a key / combination of keys stored in the RECORD_CONTENT variant field. The data in…
2
votes
1 answer

Cassandra performance using IN clause on clustering keys

Let's consider the following table CREATE TABLE base_table( partition_key uuid, clustering_key1 uuid, clustering_key2 uuid, regular text, PRIMARY KEY((partition_key), clustering_key1, clustering_key2) ); Prior to Cassandra 2.2,…
Elendil
  • 21
  • 4
2
votes
2 answers

Ordering by username in Cassandra

Let's say I have this table: CREATE TABLE "users" ( username text, created_at timeuuid, email text, firstname text, groups list, is_active boolean, lastname text, "password" text, roles list, …
Alex Tbk
  • 2,042
  • 2
  • 20
  • 38
2
votes
1 answer

Cassandra cluster key usage

I'm banging my head on this, but, frankly speaking, my brains won't get it - or so it seems. I have a column family that holds jobs for a rather large group of actors. It is a central job management and scheduling table that must be distributed and…
2
votes
1 answer

Cassandra Data Modelling and designing the Clustering

I am little confused on designing the data model for Cassandra, coming from SQL background! I have gone through Datastax documentation several times to understand many things about Cassandra! This seems to be problem and not sure how can I overcome…
RaceBase
  • 18,428
  • 47
  • 141
  • 202
1
vote
2 answers

How does the CBO uses clustering key for an ORDER BY clause in snowflake?

Test Description The test is conducted to find out how CBO uses the clustering feature, to run an ORDER BY query with the clustered key. Assumptions and Pre-Conditions According to snowflake…
1
vote
2 answers

Slow Query Performance on Large Table

I have a table that consists of 56millions rows. This table is handling high load of UPSERTS every 5 minutes as it's loading streaming data from KAFKA. Approx 200-500k updates every load. When I run a SELECT with an ORDER BY against one of the…
1
2 3 4