Re: [HACKERS] [PROPOSAL] Use SnapshotAny in get_actual_variable_range

Поиск
Список
Период
Сортировка
От Dmitriy Sarafannikov
Тема Re: [HACKERS] [PROPOSAL] Use SnapshotAny in get_actual_variable_range
Дата
Msg-id 7E4A7933-9921-47E0-BF45-DFB55747A858@yandex.ru
обсуждение исходный текст
Ответ на Re: [HACKERS] [PROPOSAL] Use SnapshotAny in get_actual_variable_range  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
> If that is the case, then how would using SnapshotAny solve this
> problem.  We get the value from index first and then check its
> visibility in heap, so if time is spent in _bt_checkkeys, why would
> using a different kind of Snapshot solve the problem?

1st scanning on the index with SnapshotAny will accept this rows and
will not mark this entries as killed.

Theremore, killed entries are ignored on standby. And scanning with
SnapshotAny will always accept first row from index.    /*     * During recovery we ignore killed tuples and don't
botherto kill them     * either. We do this because the xmin on the primary node could easily be     * later than the
xminon the standby node, so that what the primary     * thinks is killed is supposed to be visible on standby. So for
correct    * MVCC for queries during recovery we must ignore these hints and check     * all tuples. Do *not* set
ignore_killed_tuplesto true when running in a     * transaction that was started during recovery. xactStartedInRecovery
   * should not be altered by index AMs.     */    scan->kill_prior_tuple = false;    scan->xactStartedInRecovery =
TransactionStartedDuringRecovery();   scan->ignore_killed_tuples = !scan->xactStartedInRecovery; 

We execute this read-only queries on standby.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Beena Emerson
Дата:
Сообщение: Re: [HACKERS] multi-column range partition constraint
Следующее
От: Mahi Gurram
Дата:
Сообщение: [HACKERS] Regarding B-Tree Lookup