postgresql/contrib/postgres_fdw
Tom Lane 4a14f13a0a Improve hash_create's API for selecting simple-binary-key hash functions.
Previously, if you wanted anything besides C-string hash keys, you had to
specify a custom hashing function to hash_create().  Nearly all such
callers were specifying tag_hash or oid_hash; which is tedious, and rather
error-prone, since a caller could easily miss the opportunity to optimize
by using hash_uint32 when appropriate.  Replace this with a design whereby
callers using simple binary-data keys just specify HASH_BLOBS and don't
need to mess with specific support functions.  hash_create() itself will
take care of optimizing when the key size is four bytes.

This nets out saving a few hundred bytes of code space, and offers
a measurable performance improvement in tidbitmap.c (which was not
exploiting the opportunity to use hash_uint32 for its 4-byte keys).
There might be some wins elsewhere too, I didn't analyze closely.

In future we could look into offering a similar optimized hashing function
for 8-byte keys.  Under this design that could be done in a centralized
and machine-independent fashion, whereas getting it right for keys of
platform-dependent sizes would've been notationally painful before.

For the moment, the old way still works fine, so as not to break source
code compatibility for loadable modules.  Eventually we might want to
remove tag_hash and friends from the exported API altogether, since there's
no real need for them to be explicitly referenced from outside dynahash.c.

Teodor Sigaev and Tom Lane
2014-12-18 13:36:36 -05:00
..
expected Allow CHECK constraints to be placed on foreign tables. 2014-12-17 17:00:53 -05:00
sql Allow CHECK constraints to be placed on foreign tables. 2014-12-17 17:00:53 -05:00
.gitignore
connection.c Improve hash_create's API for selecting simple-binary-key hash functions. 2014-12-18 13:36:36 -05:00
deparse.c Fix mishandling of system columns in FDW queries. 2014-11-22 16:01:05 -05:00
Makefile Fix SHLIB_PREREQS use in contrib, allowing PGXS builds 2014-12-04 07:58:12 -05:00
option.c pgindent run for 9.4 2014-05-06 12:12:18 -04:00
postgres_fdw--1.0.sql
postgres_fdw.c Revert misguided change to postgres_fdw FOR UPDATE/SHARE code. 2014-12-12 12:41:49 -05:00
postgres_fdw.control
postgres_fdw.h postgres_fdw.h: don't pull in rel.h when relcache.h is enough 2014-11-14 21:48:53 -03:00