Commit graph

13 commits

Author SHA1 Message Date
Julien Rouhaud
1c87601182 Fix hypo_get_partition_constraints to follow upstream behavior. 2018-11-24 11:32:21 +01:00
yuzupy
7033609dfe Fix for pg10 partition pruning 2018-11-19 08:46:38 +01:00
Julien Rouhaud
b2f8fc6c48 Hide rte->values_lists usage with (ugly) macros 2018-11-17 20:22:00 +01:00
Julien Rouhaud
171c51bba9 Allow hypothetical index on hypothetical partition
Regression tests updated.  Also only authorize hypothetical indexes on
root partition for pg11+ to get the same behavior as postgres.
2018-11-17 15:49:57 +01:00
Julien Rouhaud
7fb9dac6b5 Store the hypothetical partitions in a hash table.
Previous naive implementation was storing the hypothetical partitions in
a simple List, which would definitely not scale if many hypothetical
partitions are stored.

The partition's children oid are also now maintained in each hypoTable
entry, for performance reason too.

Some minor fixup too while at it.
2018-11-08 18:57:54 +01:00
yuzupy
be61dc423f Change hypoTable struct to have its number of tuples 2018-11-06 10:20:23 +09:00
Julien Rouhaud
357ebdb2b3 Handle hypothetically partitioned table being dropped
Register a relcache callback, filter the relid list to keep only the one
corresponding to table that are hypothetically partitioned and
asynchronously process them.  We only care about table being dropped, so
in order to detect that we check if the relid we stored still correspond
to a table whose name is the same as the one we recorded when creating
the hypothetical objects.
2018-10-06 14:06:59 +02:00
Julien Rouhaud
21ae10ac3c Implement hypothetical multi-level partitioning. 2018-07-27 12:39:34 +02:00
Julien Rouhaud
548c1a479b Add hypopg_analyse(), to store and inject statistics on partitions.
The hypothetical statistics are stored in a hashtable in backend private
memory.  They're injected with the standard get_relation_stats_hook
hook given a (relid, attnum).

Now, we also compute the expected size and cardinality of partitions for list
and range partitioning for each partition during get_relation_info_hook
(in hypo_injectHypotheticalPartitioning()) instead of doing it in
set_rel_pathlist_hook.  This hook is now not needed anymore, so remove
it and all underlying functions.

While at it, also remove now useless function imported in hypopg_import,
remove useless includes and fix compile with pg10- versions.
2018-07-27 12:39:34 +02:00
yuzupy
4951597eee Add hypo_find_partition_scheme() instead of hypo_generate_part_scheme() 2018-07-27 12:39:34 +02:00
yuzupy
7aae71d138 Add the partition estimation feature 2018-07-27 12:39:34 +02:00
yuzupy
ef5668408a Add infrastructure to inject hypothetical partitioning 2018-07-27 12:39:34 +02:00
Julien Rouhaud
4a7158c55b Add infrastructure to declare hypothetical partitioning. 2018-07-27 12:39:34 +02:00