pgsql: Use more efficient hashtable for tidbitmap.c to speed up bitmap

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Use more efficient hashtable for tidbitmap.c to speed up bitmap
Date: 2016-10-14 23:21:28
Message-ID: E1bvBn6-0002DG-7f@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Use more efficient hashtable for tidbitmap.c to speed up bitmap scans.

Use the new simplehash.h to speed up tidbitmap.c uses. For bitmap scan
heavy queries speedups of over 100% have been measured. Both lossy and
exact scans benefit, but the wins are bigger for mostly exact scans.

The conversion is mostly trivial, except that tbm_lossify() now restarts
lossifying at the point it previously stopped. Otherwise the hash table
becomes unbalanced because the scan in done in hash-order, leaving the
end of the hashtable more densely filled then the beginning. That caused
performance issues with dynahash as well, but due to the open chaining
they were less pronounced than with the linear adressing from
simplehash.h.

Reviewed-By: Tomas Vondra
Discussion: <20160727004333(dot)r3e2k2y6fvk2ntup(at)alap3(dot)anarazel(dot)de>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/75ae538bc3168bf44475240d4e0487ee2f3bb376

Modified Files
--------------
src/backend/nodes/tidbitmap.c | 169 ++++++++++++++++++++++++------------------
1 file changed, 97 insertions(+), 72 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2016-10-15 00:28:12 pgsql: Use more efficient hashtable for execGrouping.c to speed up hash
Previous Message Tatsuo Ishii 2016-10-14 21:50:20 Re: [COMMITTERS] pgsql: Remove spurious word.