12/28/2023 0 Comments Postgresql partition byPartitioned table "affic_violations_p_hash" Postgres=# select distinct councils from mv_traffic_violations Īs usual psql will report the partitioning strategy for the table as well: When we setup the hash partitioning correctly the result would be 5 partitions: Time_of_stop | time without time zone | | |Ī good candidate would be the councils column. Materialized view "public.mv_traffic_violations"Ĭolumn | Type | Collation | Nullable | Default Having a look at our materialized view which contains our data set which columns might be a good candidate for that? In PostgreSQL hash partitioning might seem a bit strange in the beginning because you define a modulus and a remainder and that defines where the data is going to. Usually hash partitioning is used when you do not have a natural way of partitioning your data or you want to evenly distribute the data based on hash. PostgreSQL partitioning (3): List partitioning. PostgreSQL partitioning (2): Range partitioning.PostgreSQL partitioning (1): Preparing the data set.If you missed the first posts in this series here they are: The last partitioning strategy we will look at is: hash partitioning.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |