Commit graph

12 commits

Author SHA1 Message Date
Julien Rouhaud
c93081f35e Add support for hypothetical hash indexes.
Only support such indexes for PostgreSQL 10+, as they were previously not crash
safe.
2021-03-07 19:41:21 +08:00
Julien Rouhaud
3e3339b4b8 Check if access methods support an INCLUDE clause.
Trying to create an hypothetical index with an INCLUDE clause on pg10- will
obviously fail with a syntax error.

Also add regression test for the INCLUDE clause on btree indexes.
2021-02-04 00:21:53 +08:00
Julien Rouhaud
2bd376d6bd Change the Oid generator.
To avoid locking on pg_class (required to safely call GetNewOidWithIndex or
similar) and to be usable on a standby node, use the oids unused in the
FirstBootstrapObjectId / FirstNormalObjectId range rather than real oids.  For
performance, always start with the biggest oid lesser than FirstNormalObjectId.
This way the loop to find an unused oid will only happens once a single backend
has created more than ~2.5k hypothetical indexes.

For people needing to have thousands of hypothetical indexes at the same time,
we also allow to use the initial implementation that relies on real oids, which
comes with all the limitations mentioned above, with the new
hypopg.use_real_oids GUC.
2021-01-22 19:56:06 +08:00
Julien Rouhaud
0864fbe1fb Add a new hypo_get_index() function.
This will be helpful in a following patch.  The immediate effect is to fix a
long standing small performance issue, as hypo_explain_get_index_name_hook
didn't stop its loop once it found a matching entry.
2021-01-22 19:12:17 +08:00
Julien Rouhaud
5da0519a03 Update copyright year 2021-01-22 18:41:53 +08:00
Julien Rouhaud
3bb72b7492 Fix compatibility for pg13.
Patch by Michael Paquier, with backward compatibility macro by me.
2019-11-19 10:19:42 +01:00
Julien Rouhaud
4e6fce31c7 Fix compatibility for pg12. 2019-06-16 11:35:40 +02:00
Julien Rouhaud
fa9be3ff1d Split imported code in multiple files in a dedicated directory
(cherry picked from commit b5e50e6429)
2019-06-16 10:43:42 +02:00
Julien Rouhaud
b3a84ff16a pgindent run and update changelog for last msvc commit.
Also update typedefs.list
2019-06-16 10:28:39 +02:00
Godwottery
3f89878e3e 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

(cherry picked from commit 4a5dc56169)
2019-06-16 10:24:56 +02:00
Julien Rouhaud
34c2021004 Add a hypopg_reset_index() SQL wrapper.
(cherry picked from commit 72ab826d67)
2019-06-16 10:13:27 +02:00
Julien Rouhaud
25311740e0 Move code for hypothetical index in dedicated files
This is still preliminary work for further support of hypothetical
partitioning.

(cherry picked from commit a04aebe5a1)
2019-06-16 10:12:00 +02:00