Re: Synchronized Scan update - Mailing list pgsql-hackers

From Zeugswetter Andreas ADI SD
Subject Re: Synchronized Scan update
Date
Msg-id E1539E0ED7043848906A8FF995BDA57901D43427@m0143.s-mxs.net
Whole thread Raw
In response to Re: Synchronized Scan update  ("Simon Riggs" <simon@2ndquadrant.com>)
List pgsql-hackers
> > The advantage of sync_scan_offset is that, in some situations, a
> > second scan can actually finish faster than if it were the only
query
> > executing, because a previous scan has already caused some blocks to

> > be cached. However, 16 is a small number because that benefit would
> > only be once per scan, and sync scans are only helpful on large
tables.

Agreed.

> Alright, understood. That last part is actually something I
> now want to avoid because it's using the current
> cache-spoiling behaviour of seqscans to advantage. I'd like
> to remove that behaviour, but it sounds like we can have both
> - SeqScans that don't spoil cache
> - Synch scans by setting "sync_scan_offset" to zero.
>
> > > > I like the idea of reducing tuning parameters, but we should, at
a
> > > > minimum, still allow an on/off button for sync scans. My tests
> > > > revealed that the wrong combination of
> > > > OS/FS/IO-Scheduler/Controller could result in bad I/O behavior.
> > >
> > > Agreed
> > >
> >
> > Do you have an opinion about sync_scan_threshold versus a simple
> > sync_scan_enable?
>
> enable_sync_scan?

Seems the suggested guc's are very related. IIRC The agreed suggestion
was to use NBuffers (or a percentage thereof ?) to decide whether to
spoil the buffer cache for a seq scan. I seems this same metric should
be used to decide whether to sync a scan when sync scan is enabled. So
when the tablesize is below NBuffers (or a percentage thereof) you
neighter recycle buffers nor sync the seq scans.

Andreas


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Bug in UTF8-Validation Code?
Next
From: Heikki Linnakangas
Date:
Subject: Re: [PATCHES] Bitmapscan changes