Performance impact when querying without partition key on a partitioned table
0
votes
1
answer
481
views
Assuming I partition a table of large size (say 6TB) by month. We are serving very high traffic of around 300 RPS.
Sample schema
Create table mydata(
id int not null,
date_created not null,
uuid_val not null,
Primary key (id,date_created),
key uuid_idx uuid_val)
Partition by range(to_days(date_created)
What will be the performance impact if I query on this table without date_created in the where clause. It will not give a better performance for sure as it cannot do partition pruning but what will the impact if I query it based on index uuid_val as compared to a non-partitioned table with same schema?
I tried benchmarking it with 6GB data and querying(500,000 times) by index and not partition key the overhead to search in multiple partitions seemed very less (0.1ms) as compared to running the same query on the non-partitioned table.
But why is the overhead so less. Also can I expect such numbers with 6TB data too when serving high traffic?
Can I query partitioned table without partition key as I might not have in the flow.
My MySQL version is 8.
Asked by Harshita Mishra
(1 rep)
Oct 7, 2023, 11:34 AM
Last activity: Jul 1, 2025, 01:07 PM
Last activity: Jul 1, 2025, 01:07 PM