Commit graph

28 commits

Author SHA1 Message Date
Julien Rouhaud
ea1fd27765 Fix some compatibility issue with pg12.
Based on 3bb72b7492 and
4e6fce31c7.  A lot more is still needed to get
the hypothetical partitionning part compatible with pg12.
2020-03-31 18:01:20 +02:00
Julien Rouhaud
db7c6a38d8 Use ResolveOpClass for pg10+ instead of imported GetIndexOpClass. 2019-07-14 20:47:21 +02:00
Yuzuko Hosoya
4aefb2de9b Disable runtime partition pruning on hypothetical partitioned table
Unfortunately, the runtime partition pruning code in v11 is written in such a
way that it can't be made compatible with hypothetical partitioning.
2019-07-13 09:13:58 +02:00
Julien Rouhaud
19af48499e Use ctelevelsup in lieu of values_lists for saving hypo table oid.
An upcoming patch to fix runtime partition pruning issue will need a field that
will survive planning time.
2019-04-11 11:15:53 +02:00
Julien Rouhaud
b5e50e6429 Split imported code in multiple files in a dedicated directory 2019-04-09 21:34:35 +02:00
Julien Rouhaud
acd87ef01a pgindent run and update changelog for last msvc commit.
Also update typedefs.list.
2019-01-20 19:40:45 +01:00
Godwottery
4a5dc56169 Compile and use on Windows (#36)
* Add PGDLLEXPORT to functions called externally

* Make it compile with Visual Studio (it doesn't support #ifdef in macros)

* Add explicit type-cast so silence compiler warnings.

* Replace {INT_MAX | INT32_MAX } with PG_INT32_MAX
2019-01-20 19:24:16 +01:00
yuzupy
12bc46965e Fix hypothetical partitioning expansion for pg10 2018-12-03 14:13:03 +01:00
Julien Rouhaud
1c87601182 Fix hypo_get_partition_constraints to follow upstream behavior. 2018-11-24 11:32:21 +01:00
Julien Rouhaud
c79bebd1c6 Remove some forgotten pieces of default partition for pg10 2018-11-23 21:53:38 +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
aa8948d579 Fix pending inval process with hypo_table_reset() 2018-11-17 12:31:05 +01:00
Julien Rouhaud
eefa430ed9 Start working on hypothetical partitioning pg10 compatibility.
This is the easy part: get rid of the features added in pg11 such as
hash partitioning or default partition, and adapt the required imports.

There are still a lot of errors due to the lack of PartitionScheme and
many fields in RelOptInfo in pg10.
2018-11-17 10:41:31 +01:00
Julien Rouhaud
f07b82e387 Drop any pending invalidation if we unpartition a table. 2018-11-15 21:49:21 +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
946d0f6ac4 Add missing hypopg_statistic prototype 2018-07-27 12:39:34 +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
Julien Rouhaud
72ab826d67 Add a hypopg_reset_index() SQL wrapper. 2018-07-27 12:39:34 +02:00
Julien Rouhaud
a04aebe5a1 Move code for hypothetical index in dedicated files
This is still preliminary work for further support of hypothetical
partitioning.
2018-07-27 12:39:34 +02:00