pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedTuning threshold for BAS_BULKREAD (large tables)
3+ messages / 2 participants
[nested] [flat]
* Tuning threshold for BAS_BULKREAD (large tables)
@ 2019-01-22 07:35 Jamison, Kirk <k.jamison@jp.fujitsu.com>
0 siblings, 1 reply; 3+ messages in thread
From: Jamison, Kirk @ 2019-01-22 07:35 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Hi,
I have a source code-related question on BufferAccessStrategyType BAS_BULKREAD.
Currently, this access method is set internally to cache tables larger than 1/4 of shared_buffers.
src/backend/access/heap/heapam.c:initscan()
if (!RelationUsesLocalBuffers(scan->rs_rd) &&
scan->rs_nblocks > NBuffers / 4)
...
/* During a rescan, keep the previous strategy object. */
if (scan->rs_strategy == NULL)
scan->rs_strategy = GetAccessStrategy(BAS_BULKREAD);
Users can tune their shared_buffers size, but not able to tune this component.
I'm just wondering how it affects the current workload when the table size is larger than the database.
Does it really cache the large tables in shared buffers? How does it affect other buffers/pages stored in the shared buffers?
Oracle also has a quite-related user parameter that allocates space for large tables in the buffer cache.
https://docs.oracle.com/database/121/VLDBG/GUID-A553169D-C6CD-443E-88C3-B746D5E32923.htm#VLDBG14145
I want to ask how has PostgreSQL optimized this with synchronized sequential scans, etc.?
If it's beneficial, I'm wondering if it would be helpful also in Postgres for users to tune it instead of the hardcoded threshold (Nbuffers / 4)?
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Tuning threshold for BAS_BULKREAD (large tables)
@ 2019-01-22 08:36 Ron <ronljohnsonjr@gmail.com>
parent: Jamison, Kirk <k.jamison@jp.fujitsu.com>
0 siblings, 1 reply; 3+ messages in thread
From: Ron @ 2019-01-22 08:36 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
On 1/22/19 1:35 AM, Jamison, Kirk wrote:
>
> Hi,
>
> I have a source code-related question on BufferAccessStrategyType
> BAS_BULKREAD.
>
> Currently, this access method is set internally to cache tables larger
> than 1/4 of shared_buffers.
>
> src/backend/access/heap/heapam.c:initscan()
>
> if (!RelationUsesLocalBuffers(scan->rs_rd) &&
>
> scan->rs_nblocks > NBuffers / 4)
>
> ...
>
> /* During a rescan, keep the previous strategy object. */
>
> if (scan->rs_strategy == NULL)
>
> scan->rs_strategy = GetAccessStrategy(BAS_BULKREAD);
>
> Users can tune their shared_buffers size, but not able to tune this component.
>
> I'm just wondering how it affects the current workload when the table size
> is larger than the database.
>
How can a subset of the database be larger than the database?
--
Angular momentum makes the world go 'round.
^ permalink raw reply [nested|flat] 3+ messages in thread
* RE: Tuning threshold for BAS_BULKREAD (large tables)
@ 2019-01-22 09:00 Jamison, Kirk <k.jamison@jp.fujitsu.com>
parent: Ron <ronljohnsonjr@gmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: Jamison, Kirk @ 2019-01-22 09:00 UTC (permalink / raw)
To: Ron <ronljohnsonjr@gmail.com>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
On Tuesday, January 22, 2019 5:36 PM, Ron wrote:
>How can a subset of the database be larger than the database?
Oops. Sorry, I made a mistake on that part. What I meant was how does Postgres handle the large relations caching in terms of performance, especially if majority of the data it has to read would take up most of the shared buffers. Say, more than 3/4 of shared buffers. Is the current buffer access strategy (BAS_BULKREAD) optimal for this?
From: Ron [mailto:ronljohnsonjr@gmail.com]
Sent: Tuesday, January 22, 2019 5:36 PM
To: pgsql-general@lists.postgresql.org
Subject: Re: Tuning threshold for BAS_BULKREAD (large tables)
On 1/22/19 1:35 AM, Jamison, Kirk wrote:
Hi,
I have a source code-related question on BufferAccessStrategyType BAS_BULKREAD.
Currently, this access method is set internally to cache tables larger than 1/4 of shared_buffers.
src/backend/access/heap/heapam.c:initscan()
if (!RelationUsesLocalBuffers(scan->rs_rd) &&
scan->rs_nblocks > NBuffers / 4)
...
/* During a rescan, keep the previous strategy object. */
if (scan->rs_strategy == NULL)
scan->rs_strategy = GetAccessStrategy(BAS_BULKREAD);
Users can tune their shared_buffers size, but not able to tune this component.
I'm just wondering how it affects the current workload when the table size is larger than the database.
How can a subset of the database be larger than the database?
--
Angular momentum makes the world go 'round.
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2019-01-22 09:00 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-01-22 07:35 Tuning threshold for BAS_BULKREAD (large tables) Jamison, Kirk <k.jamison@jp.fujitsu.com>
2019-01-22 08:36 ` Ron <ronljohnsonjr@gmail.com>
2019-01-22 09:00 ` Jamison, Kirk <k.jamison@jp.fujitsu.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox