# Select \* with static columns efficiently

**URL:** <https://forum.scylladb.com/t/select-with-static-columns-efficiently/1088>\
**Category:** ScyllaDB\
**Tags:** data-model\
**Created:** [December 7, 2023, 1:11pm UTC](https://forum.scylladb.com/t/select-with-static-columns-efficiently/1088 "2023-12-07T13:11:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RoDmitry](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/rodmitry/32/541_2.png) [@RoDmitry](https://forum.scylladb.com/u/RoDmitry)\
**Post date:** [December 7, 2023, 1:11pm UTC](https://forum.scylladb.com/t/select-with-static-columns-efficiently/1088/1 "2023-12-07T13:11:00Z")

</div>

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 🙂

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 *`

---

<div class="post-metadata">

**Author:** ![Botond\_Denes](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/botond_denes/32/163_2.png) [@Botond\_Denes](https://forum.scylladb.com/u/Botond_Denes)\
**Post date:** [December 14, 2023, 6:55am UTC](https://forum.scylladb.com/t/select-with-static-columns-efficiently/1088/2 "2023-12-14T06:55:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![RoDmitry](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/rodmitry/32/541_2.png) [@RoDmitry](https://forum.scylladb.com/u/RoDmitry)\
**Post date:** [December 14, 2023, 9:51am UTC](https://forum.scylladb.com/t/select-with-static-columns-efficiently/1088/3 "2023-12-14T09:51:12Z")

</div>

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