diff options
| author | Alvaro Herrera | 2017-04-07 21:54:26 +0000 |
|---|---|---|
| committer | Alvaro Herrera | 2017-04-07 22:08:43 +0000 |
| commit | 8bf74967dab1b368f4e217c960ede1516c42a989 (patch) | |
| tree | 61090aa24b2761d6f731b5a56d769cb94961d35b /contrib/pageinspect/brinfuncs.c | |
| parent | e8fdbd58fe564a29977f4331cd26f9697d76fc40 (diff) | |
Reduce the number of pallocs() in BRIN
Instead of allocating memory in brin_deform_tuple and brin_copy_tuple
over and over during a scan, allow reuse of previously allocated memory.
This is said to make for a measurable performance improvement.
Author: Jinyu Zhang, Álvaro Herrera
Reviewed by: Tomas Vondra
Discussion: https://postgr.es/m/495deb78.4186.1500dacaa63.Coremail.beijing_pg@163.com
Diffstat (limited to 'contrib/pageinspect/brinfuncs.c')
| -rw-r--r-- | contrib/pageinspect/brinfuncs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/pageinspect/brinfuncs.c b/contrib/pageinspect/brinfuncs.c index 2c7963ec19b..dc9cc2d09aa 100644 --- a/contrib/pageinspect/brinfuncs.c +++ b/contrib/pageinspect/brinfuncs.c @@ -226,7 +226,8 @@ brin_page_items(PG_FUNCTION_ARGS) if (ItemIdIsUsed(itemId)) { dtup = brin_deform_tuple(bdesc, - (BrinTuple *) PageGetItem(page, itemId)); + (BrinTuple *) PageGetItem(page, itemId), + NULL); attno = 1; unusedItem = false; } |
