summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Freund2018-01-24 07:20:02 +0000
committerAndres Freund2018-02-05 16:00:11 +0000
commit0fede6b8d6cee6bb0999f68fd1aa02dfe4e1386d (patch)
treed0387ee9a519047a1b1ceb34e0a39df8910f8f04
parent8afcaaa57e3362ecbd47fd1c815790a3c864fd3e (diff)
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 8a846e7dba..d36c4826a4 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))
{
@@ -2089,8 +2096,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