Select * with static columns efficiently

For example I have the following table:
(pk, ck1, ck2, s1 STATIC, s2 STATIC, v1, v2)

I have multiple rows with the same pk,
and if I request select * where pk = 1, it will return copies of static columns for each row.

My question is: Is there any way to save wire?
Maybe it’s just my perfectionism :slight_smile:

I see following options:

  • send multiple select queries simultaneously (select all static, and select all non-static columns)
    Will It work slower? Or (I thought if it’s a columnar storage) it will be the same. Or it still will be slower because of pk hashing?

  • it will not copy static columns in the response, you are wrong

  • just select *

I think that for most CQL types, just using SELECT * is the best option. If your static columns are text or blob and you have really large values and a lot of small clustering row, then two separate queries (one for the static columns only, another for the rest), might make sense. I don’t know what is the size of values above which this makes sense. If I had to guess, I would say, in the MB range.

Note that ScyllaDB internally uses a transfer format which stores static columns just once per partition. It is only from the coordinator to the application which uses the tabular format, which includes static columns on each row.

Thanks. I wish it would not use the tabular format, and send the data in a more efficient way.