Improving the heapgetpage function improves performance in common scenarios - Mailing list pgsql-hackers

From Quan Zongliang
Subject Improving the heapgetpage function improves performance in common scenarios
Date
Msg-id a9f40066-3d25-a240-4229-ec2fbe94e7a5@yeah.net
Whole thread Raw
Responses Re: Improving the heapgetpage function improves performance in common scenarios
List pgsql-hackers
Hi

In the function heapgetpage. If a table is not updated very frequently. 
Many actions in tuple loops are superfluous. For all_visible pages, 
loctup does not need to be assigned, nor does the "valid" variable. 
CheckForSerializableConflictOutNeeded from 
HeapCheckForSerializableConflictOut function, it only need to inspect at 
the beginning of the cycle only once. Using vtune you can clearly see 
the result (attached heapgetpage.jpg).

So by splitting the loop logic into two parts, the vtune results show 
significant improvement (attached heapgetpage-allvis.jpg).

The test data uses TPC-H's table "orders" with a scale=20, 30 million rows.


Quan Zongliang
Attachment

pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: Report planning memory in EXPLAIN ANALYZE
Next
From: Heikki Linnakangas
Date:
Subject: Use FD_CLOEXEC on ListenSockets (was Re: Refactoring backend fork+exec code)