Re: Slow planning time for simple query - Mailing list pgsql-general

From Andrew Gierth
Subject Re: Slow planning time for simple query
Date
Msg-id 87po0pr97m.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: Slow planning time for simple query  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-general
>>>>> "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)


pgsql-general by date:

Previous
From: Benjie Gillam
Date:
Subject: Re: Detecting functions installed by an extension
Next
From: Bruno Wolff III
Date:
Subject: Re: Trying to understand odd trigger behavior