Re: determine snapshot after obtaining locks for first statement

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: determine snapshot after obtaining locks for first statement
Дата
Msg-id 4B29D8B0020000250002D67F@gw.wicourts.gov
обсуждение исходный текст
Список pgsql-hackers
Tom Lane  wrote:
> "Kevin Grittner"  writes:
>> Tom Lane  wrote:
>>> (Besides which the lock acquired by UPDATE isn't exclusive and
>>> wouldn't block anyway...)
>> It blocks other UPDATEs.
> Not at the table level.
The question was about whether we could change the timing of when
we get the current locks, not about getting different locks than we
currently do.  Clearly, adding a table lock would make no sense.
> If you could lock only at the tuple level maybe you'd have
> something, but it seems like you can't find the target tuples
> without having acquired a snapshot.
That would be the fatal difference then.  InnoDB doesn't actually
keep old versions of a row; it generates them from "undo" records in
the log when needed, which might be why it was feasible to get the
lock before the snapshot there.  If we need the snapshot before we
can get the lock, it's not an optimization which is available to us.
Thanks,
-Kevin


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Hot Standby and prepared transactions
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Hot Standby and prepared transactions