Function partition_hash not working as expected

Yes it will. But you didn’t add time to the partition key. Need to be like this:

PRIMARY KEY ((data_id, time))

Depends on your queries. The rows for a single data_id will be spread on multiple tablets (probably on all tablets).

Is this time-series and you’re deleting old data? If yes, you can do partitioning on multiple tables and then you just “drop” or “truncate” old tables. Like I explained in Database schema in YugabyteDB for storing statistics collected periodically

Getting a timeout on a query in a tablet means that there are just too many tombstones that haven’t been compacted. A compact table command should fix this yb-ts-cli - command line tool for advanced yb-tserver operations | YugabyteDB Docs

There should be a way, I’ll ask internally. This is for the DELETE statement, correct?