summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Freund2018-01-24 07:20:02 +0000
committerAndres Freund2018-01-29 09:44:57 +0000
commitfff9076c8ec5fd870e6ed338e7b7e91b71b4396c (patch)
tree9d6df67e1b3a0718f0bd9f51e498e1f316d4874a
parent33a3e51d3d1b887ca61aebd40544ee9f795c0bb0 (diff)
WIP: Faster order.
This breaks regression tests, but yields quite impressive speedups.
-rw-r--r--src/backend/access/heap/heapam.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index be263850cd..a9a287a265 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -421,9 +421,16 @@ heapgetpage(HeapScanDesc scan, BlockNumber page)
*/
all_visible = PageIsAllVisible(dp) && !snapshot->takenDuringRecovery;
+//#define FASTORDER
+#ifdef FASTORDER
+ for (lineoff = lines, lpp = PageGetItemId(dp, lineoff);
+ lineoff >= FirstOffsetNumber;
+ lineoff--, lpp--)
+#else
for (lineoff = FirstOffsetNumber, lpp = PageGetItemId(dp, lineoff);
lineoff <= lines;
lineoff++, lpp++)
+#endif
{
if (ItemIdIsNormal(lpp))
{
@@ -2069,8 +2076,9 @@ heap_hot_search_buffer(ItemPointer tid, Relation relation, Buffer buffer,
/*
* Shouldn't see a HEAP_ONLY tuple at chain start.
*/
- if (at_chain_start && HeapTupleIsHeapOnly(heapTuple))
- break;
+ Assert(!(at_chain_start && HeapTupleIsHeapOnly(heapTuple)));
+ //if (at_chain_start && HeapTupleIsHeapOnly(heapTuple))
+ // break;
/*
* The xmin should match the previous xmax value, else chain is