Re: Removal of currtid()/currtid2() and some table AM cleanup

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: "Inoue, Hiroshi" <h-inoue(at)dream(dot)email(dot)ne(dot)jp>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Hiroshi Saito <hiroshi(at)winpg(dot)jp>
Subject: Re: Removal of currtid()/currtid2() and some table AM cleanup
Date: 2020-06-23 05:02:33
Message-ID: 20200623050233.GJ50978@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 23, 2020 at 01:29:06PM +0900, Michael Paquier wrote:
> Sorry, but I am not quite sure what is the relationship between
> UseDeclareFetch and currtid2()? Is that related to the use of
> SQL_CURSOR_KEYSET_DRIVEN? The only thing I can be sure of here is
> that we never call currtid2() in any of the regression tests present
> in the ODBC code for any of the scenarios covered by installcheck-all,
> so that does not really bring any confidence that removing currtid2()
> is a wise thing to do, because we may silently break stuff. If the
> function is used, it would be good to close the gap with a test to
> stress that at least in the driver.

Actually, while reviewing the code, the only code path where we use
currtid2() involves positioned_load() and LATEST_TUPLE_LOAD. And the
only location where this happens is in SC_pos_reload_with_key(), where
I don't actually see how it would be possible to not have a keyset and
still use a CTID, which would led to LATEST_TUPLE_LOAD being used. So
could it be possible that the code paths of currtid2() are actually
just dead code?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2020-06-23 05:28:18 Re: Resetting spilled txn statistics in pg_stat_replication
Previous Message Eric Ridge 2020-06-23 04:46:11 Re: Threading in BGWorkers (!)