Questions tagged [clustering-key]

43 questions
16
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
  • 747
  • 1
  • 10
  • 17
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

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
  • 521
  • 1
  • 10
  • 31
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…
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,610
  • 14
  • 53
  • 81
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…
PeriChandra
  • 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
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
  • 1,574
  • 2
  • 14
  • 31
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…
Reddy
  • 16,522
  • 43
  • 127
  • 190
1
vote
2 answers

How clustering is helping in query pruning in Snowflake?

I have a table clustered on s_nation_key as below. create or replace table t1 ( S_SUPPKEY string, S_NAME string, S_NATIONKEY string, S_ADDRESS string, S_ACCTBAL string) cluster by (S_NATIONKEY); Now i have added data to it INSERT INTO …
Paul
  • 197
  • 2
  • 12
1
vote
0 answers

I want to know the x and y axes labels of dbscan (sklearn) algorithm

https://scikit-learn.org/stable/auto_examples/cluster/plot_dbscan.html#sphx-glr-auto-examples-cluster-plot-dbscan-py This is the link of sklearn dbcsan.
J.l
  • 31
  • 1
1
vote
1 answer

Performance of query with only partition key

Is the performance impacted if I provide only the partition key while querying a table containing both partition key and clustering key? For example, for a table with partition key p1 and clustering key c1, would SELECT * FROM table1 where p1 =…
tourniquet_grab
  • 662
  • 7
  • 14
1
vote
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
  • 11
  • 3
1
2 3