1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Improve hash_any() to use word-wide fetches when hashing suitably aligned

data.  This makes for a significant speedup at the cost that the results
now vary between little-endian and big-endian machines; which forces us
to add explicit ORDER BYs in a couple of regression tests to preserve
machine-independent comparison results.  Also, force initdb by bumping
catversion, since the contents of hash indexes will change (at least on
big-endian machines).

Kenneth Marshall and Tom Lane, based on work from Bob Jenkins.  This commit
does not adopt Bob's new faster mix() algorithm, however, since we still need
to convince ourselves that that doesn't degrade the quality of the hashing.
This commit is contained in:
Tom Lane
2008-04-06 16:54:49 +00:00
parent d785b39fbf
commit 2604359251
6 changed files with 232 additions and 60 deletions

View File

@ -340,7 +340,15 @@ UNION
(SELECT * from dblink_get_result('dtest3') as t3(f1 int, f2 text, f3 text[]))
ORDER by f1;
SELECT dblink_get_connections();
-- dblink_get_connections returns an array with elements in a machine-dependent
-- ordering, so we must resort to unnesting and sorting for a stable result
create function unnest(anyarray) returns setof anyelement
language sql strict immutable as $$
select $1[i] from generate_series(array_lower($1,1), array_upper($1,1)) as i
$$;
SELECT * FROM unnest(dblink_get_connections()) ORDER BY 1;
SELECT dblink_is_busy('dtest1');
SELECT dblink_disconnect('dtest1');