I have use case where my every query has this filters date
and country
, so i want to have table where i can partitioned it by date under each date partition, i can subpartitioned/clusterd by country. So All queries will be very fast insert
, update
and delete
.
For MYSQL i can see this i can use PARTITION
and SUBPARTITION
clause but does Postgresql support this i can't find any straight forward solution ?
Which will be the best fit in this scenario, as my data contains 500 Millions of rows, and i need to created indexes on additional 2-4
columns ?
n
). Indexes divide the data by an exponentially more efficient algorithm (typicallylog(n)
). So correctly implemented indexes are always going to be more performant than using partitioning. Just like nbk said, partitioning isn't meant for performance improvements - for most cases. It's a data management tool instead. One use case it could be helpful in, is if you had rolling data, and you wanted to delete an entire partition at a time, then you can drop the entire partition as one, instead of deleting every row in it.