Re: Small improvement to compactify_tuples
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Claudio Freire <klaussfreire@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Andres Freund <andres@anarazel.de>, Юрий Соколов <funny.falcon@gmail.com>, Sokolov Yura <funny.falcon@postgrespro.ru>, Alvaro Herrera <alvherre@2ndquadrant.com>, Heikki Linnakangas <hlinnaka@iki.fi>, PostgreSQL-Dev <pgsql-hackers@postgresql.org>
Date: 2017-11-08T17:02:40Z
Lists: pgsql-hackers
Claudio Freire <klaussfreire@gmail.com> writes: > What's perhaps not clear is whether there are better ideas. Like > rebuilding the page as Tom proposes, which doesn't seem like a bad > idea. Bucket sort already is O(bytes), just as memcopy, only it has a > lower constant factor (it's bytes/256 in the original patch), which > might make copying the whole page an extra time lose against bucket > sort in a few cases. > Deciding that last point does need more benchmarking. That doesn't > mean the other improvements can't be pursued in the meanwhile, right? Well, I doubt we're going to end up committing more than one of these ideas. The question is which way is best. If people are willing to put in the work to test all of them, let's do it. BTW, it strikes me that in considering the rebuild-the-page approach, we should not have blinders on and just measure the speed of PageRepairFragmentation. Rather, we should take a look at what happens subsequently given a physically-ordered set of tuples. I can recall Andres or someone moaning awhile ago about lack of locality of access in index page searches --- maybe applying that approach while vacuuming indexes will help? regards, tom lane
Commits
-
Avoid looping through line pointers twice in PageRepairFragmentation().
- a9169f0200fc 11.0 landed
-
Reduce pinning and buffer content locking for btree scans.
- 2ed5b87f96d4 9.5.0 cited
-
Speed up in-memory tuplesorting.
- 337b6f5ecf05 9.2.0 cited