From: | Andres Freund <andres(at)anarazel(dot)de> |
---|---|
To: | "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Should CreateExprContext() be using ALLOCSET_DEFAULT_SIZES? |
Date: | 2023-02-17 04:01:31 |
Message-ID: | 20230217040131.5jtdaybrpld4my25@awork3.anarazel.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
The thread around https://postgr.es/m/CADUqk8Uqw5QaUqLdd-0SBCvZVncrE3JMJB9+yDwO_uMv_hTYCg@mail.gmail.com
reminded me of the following:
ISTM that we really shouldn't use ALLOCSET_DEFAULT_SIZES for expression
contexts, as they most commonly see only a few small, or no, allocations.
That's true for OLTPish queries, but is is very often true even for analytics
queries.
Just because I had it loaded, here's the executor state for TPCH-Q01, which is
pretty expression heavy:
ExecutorState: 65536 total in 4 blocks; 42512 free (11 chunks); 23024 used
TupleSort main: 32832 total in 2 blocks; 7320 free (7 chunks); 25512 used
TupleSort sort: 8192 total in 1 blocks; 7928 free (0 chunks); 264 used
Caller tuples: 8192 total in 1 blocks (9 chunks); 6488 free (0 chunks); 1704 used
ExprContext: 8192 total in 1 blocks; 7928 free (0 chunks); 264 used
ExprContext: 8192 total in 1 blocks; 7928 free (0 chunks); 264 used
ExprContext: 8192 total in 1 blocks; 7928 free (0 chunks); 264 used
Grand total: 139328 bytes in 11 blocks; 88032 free (18 chunks); 51296 used
As you can see very little was allocated in the ExprContext's.
ISTM that we could save a reasonable amount of memory by using a smaller
initial size.
Not so sure if a smaller max size should be used though.
Greetings,
Andres Freund
From | Date | Subject | |
---|---|---|---|
Next Message | Pavel Stehule | 2023-02-17 04:04:31 | Re: proposal: psql: psql variable BACKEND_PID |
Previous Message | Andres Freund | 2023-02-17 03:40:00 | Re: Reducing System Allocator Thrashing of ExecutorState to Alleviate FDW-related Performance Degradations |