pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Maksim Milyutin <milyutinma@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Slow planning time for simple query
Date: Sun, 17 Jun 2018 11:39:30 +0100
Message-ID: <87po0pr97m.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <CAA4eK1+oP+RRG0uJSWpw=oFf3q3TPdhhRRp5byY7PSwK9H8sMw@mail.gmail.com>
References: <36adf760-680b-7a4a-e019-64f4eaaf6ff7@gmail.com>
	<9661.1528573749@sss.pgh.pa.us>
	<CAA4eK1+oP+RRG0uJSWpw=oFf3q3TPdhhRRp5byY7PSwK9H8sMw@mail.gmail.com>

>>>>> "Amit" == Amit Kapila <amit.kapila16@gmail.com> writes:

 >> Presumably the problem is that the standby isn't authorized to change
 >> the btree index's "entry is dead" bits,

 Amit> I don't see anything like that in the code. We use _bt_killitems
 Amit> to mark the items as dead and neither that function or any of its
 Amit> caller has any such assumption.

See index_fetch_heap:

	/*
	 * If we scanned a whole HOT chain and found only dead tuples, tell index
	 * AM to kill its entry for that TID (this will take effect in the next
	 * amgettuple call, in index_getnext_tid).  We do not do this when in
	 * recovery because it may violate MVCC to do so.  See comments in
	 * RelationGetIndexScan().
	 */
	if (!scan->xactStartedInRecovery)
		scan->kill_prior_tuple = all_dead;

(this is the only place where kill_prior_tuple can be set to true)

-- 
Andrew (irc:RhodiumToad)




view thread (22+ messages)  latest in thread

Message-ID: <87po0pr97m.fsf@news-spur.riddles.org.uk>
Permalink:  ../87po0pr97m.fsf@news-spur.riddles.org.uk/
Also on:    postgresql.org/message-id/87po0pr97m.fsf@news-spur.riddles.org.uk

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: andrew@tao11.riddles.org.uk, amit.kapila16@gmail.com, tgl@sss.pgh.pa.us, milyutinma@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Slow planning time for simple query
  In-Reply-To: <87po0pr97m.fsf@news-spur.riddles.org.uk>
  References: <36adf760-680b-7a4a-e019-64f4eaaf6ff7@gmail.com> <9661.1528573749@sss.pgh.pa.us> <CAA4eK1+oP+RRG0uJSWpw=oFf3q3TPdhhRRp5byY7PSwK9H8sMw@mail.gmail.com> <87po0pr97m.fsf@news-spur.riddles.org.uk>

* 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