pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: pg_dump test instability
Date: Thu, 13 Sep 2018 09:54:54 +0200
Message-ID: <080c109e-0426-0aff-7a88-c0ea9399fa56@2ndquadrant.com> (raw)
In-Reply-To: <6771.1536768395@sss.pgh.pa.us>
References: <5137fe12-d0a2-4971-61b6-eb4e7e8875f8@2ndquadrant.com>
	<32399.1535379095@sss.pgh.pa.us>
	<20180827144138.GO3326@tamriel.snowman.net>
	<1665.1535381158@sss.pgh.pa.us>
	<20180827155943.GP3326@tamriel.snowman.net>
	<1765.1535482037@sss.pgh.pa.us>
	<406b7f39-039d-6cfc-6d36-ee797d214af7@2ndquadrant.com>
	<6771.1536768395@sss.pgh.pa.us>

On 12/09/2018 18:06, Tom Lane wrote:
> No.  In both code paths, the array slot at index first_te is being
> physically dropped from the set of valid entries (by incrementing
> first_te).  In the first path, that slot holds the item we want to
> remove logically from the set, so that incrementing first_te is
> all we have to do: the remaining entries are still in the range
> first_te..last_te, and they're still sorted.  In the second code
> path, the item that was in that slot is still wanted as part of
> the set, so we copy it into the valid range (overwriting the item
> in slot i, which is no longer wanted).  Now the valid range is
> probably not sorted, so we have to flag that a re-sort is needed.

I see.  Why not shift all items up to the i'th up by one place, instead
of moving only the first one?  That way the sortedness would be
preserved.  Otherwise we'd move the first one into the middle, then
sorting would move it to the front again, etc.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




view thread (14+ messages)  latest in thread

Message-ID: <080c109e-0426-0aff-7a88-c0ea9399fa56@2ndquadrant.com>
Permalink:  ../080c109e-0426-0aff-7a88-c0ea9399fa56@2ndquadrant.com/
Also on:    postgresql.org/message-id/080c109e-0426-0aff-7a88-c0ea9399fa56@2ndquadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: peter.eisentraut@2ndquadrant.com, tgl@sss.pgh.pa.us, sfrost@snowman.net
  Subject: Re: pg_dump test instability
  In-Reply-To: <080c109e-0426-0aff-7a88-c0ea9399fa56@2ndquadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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