mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user