Commit graph

30 commits

Author SHA1 Message Date
Julien Rouhaud
723adb4bb9 Warn about broken hypothetical BRIN indexes in some minor versions.
Hypothetical BRIN indexes are broken in some minor versions of pg10, pg11 and
pg12.  Detect those versions and warn users with a useful error message
recommending to update their minor versions of postgres.

Also add regression tests to make sure that support BRIN hypothetical indexes
doesn't get broken again.
2020-02-22 14:42:31 +01:00
Julien Rouhaud
e7022704db Fix failure with hypo index on unexisting table for pg10+. 2020-02-22 13:51:50 +01: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
951ea5fed2 Add regression test for rutime partitiong pruning, pg11+
This unfortunately can't be supported in pg11.  Current code is currently
broken, so later commit will add a proper fix to disable runtime partition
pruning on hypothetically partitioned tables.
2019-06-26 21:53:20 +02:00
Julien Rouhaud
ad1cc8319e Add unique identifier in regression tests comments
Some tests were previously too similar, making it hard to distinguish which
test was exactly failing.  This will help a little bit in such cases.
2019-06-26 20:22:29 +02:00
Julien Rouhaud
75c8987e2b Check for (hypo) constraint compatibility with (hypo) partitioning 2018-12-09 11:25:53 +01:00
Julien Rouhaud
c19cbe30f9 Add forgotten regression tests for pg10. 2018-12-04 09:23:58 +01:00
Julien Rouhaud
db266cb458 Add real partitioning for sanity checks regressino tests. 2018-11-23 21:21:59 +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
3a18286a5c Add specific regression tests for pg10- versions 2018-11-17 12:01:11 +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
ffcd3c7cc0 Add default partition tests to the regression test 2018-11-07 13:52:25 +09:00
Julien Rouhaud
e9cbdb0645 Add a hypopg_drop_table(oid) wrapper.
The underlying C function was already existing, I just forgot to add the
SQL wrapper.

The C function is modified to add an error if the function is called on
a non hypothetically partitioned table instead of silently doing
nothing, and add regression tests.
2018-11-04 13:42:07 +01:00
Julien Rouhaud
efb1ac04f3 Correctly handle childless hypothetical partitioned tables. 2018-11-04 13:17:27 +01:00
yuzupy
2c78f310dd Add test for hypothetical indexes on hypothetical partitioning 2018-10-12 11:23:42 +09:00
yuzupy
473749cc41 Forbit hypopg_analyze() on hypothetical hash partitioning 2018-10-10 11:58:04 +09:00
Julien Rouhaud
0f1e6bd9c5 Forbid unhandled DML on hypothatical partition 2018-10-07 12:55:38 +02: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
yuzupy
ee5961a736 Add a test case of creating hypothetical partitions in different order 2018-10-04 11:53:26 +09:00
Julien Rouhaud
d865dcb5b2 Add sanity check on partition bounds.
Also add basic regression tests for this.  Thanks to yuzupy for spotting this.
2018-08-24 00:14:49 +02:00
yuzupy
edcd2c815e Modify hypo_expand_partitioned_entry() and the regression test for join queries using subpartitioning 2018-08-06 18:53:15 +09:00
Julien Rouhaud
37d6cb56ce Start adding some regression test for hypothetical partitioning.
This will fail on pg10- servers, but since hypothetical partitioning has
some feature not covered by regression tests, a full coverage of hypopg for all
pg versions will be done in other commit(s).
2018-07-27 12:39:34 +02:00
Julien Rouhaud
73d82eee94 Make tests more portable.
The estimated index size depends on the architecture, so just make
sure the code path is tested, without really caring of what the
estimated size is.  Thanks to Christoph Berg for the report.
2018-03-27 19:48:41 +02:00
Julien Rouhaud
79220f2c71 Fix NULL ordering for SORTBY_DESC case. Thanks to Andrew Kane for the
report and test case.
2017-09-05 06:45:31 +02:00
Julien Rouhaud
d2cfd7898f Add a hypopg_get_indexdef(oid) function 2016-11-16 23:49:27 +01:00
Julien Rouhaud
c05e2da4f7 Add support for hypothetical indexes on expression.
The estimation (size and cardinality) will probably always be very poor, the
postgres infrastructure get accurate informations by analyzing a real
index.  One consequence is that almost only Bitmap Index Scan will be
chosen by the planner.

Some simple and frequent expressions are explicitely handled (for now md5(),
lower() and uppser()), but it only impacts the estimated size, not the
selectivity.
2016-11-15 15:31:09 +01:00
Julien Rouhaud
022ac3396e Add regression test for expression indexes.
This has already been broken twice, make sure it won't happen again.
2016-06-07 20:10:04 +02:00
Julien Rouhaud
079a4f7610 Test hypopg.enabled GUC 2015-09-14 17:49:33 +02:00
Julien Rouhaud
1f211190fd Add some more tests 2015-09-03 19:02:32 +02:00
Julien Rouhaud
3bf0e6d118 Add some basic regression test. 2015-07-11 10:28:34 +02:00