summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Freund2018-01-24 07:20:02 +0000
committerAndres Freund2018-02-07 14:45:40 +0000
commite24cac5951575cf86f138080acec663a0a05983e (patch)
tree41652ae07fcfae3b7f7f3a83f2a535cc727ad97d
parentee3d4b750530d7305a2094746eb03edc8740a6fe (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