Re: Updatable cursors thoughts

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Updatable cursors thoughts
Дата
Msg-id 20263.1181524392@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Updatable cursors thoughts  ("Simon Riggs" <simon@2ndquadrant.com>)
Список pgsql-hackers
"Simon Riggs" <simon@2ndquadrant.com> writes:
> Sounds good. The cost is paid by the WHERE CURRENT OF query, not as an
> overhead on all cursors. Sounds like it will still be very fast too.

Yeah, there's zero added cost in the existing code paths, and the lookup
isn't really that expensive.

> Presumably still disallowing the WITH HOLD case.

Right --- once you've committed, you can't be sure the rows are still
there to look at.

I just finished revising the patch and am about to commit it.  In the
event, my idea of a separate lookup function didn't work so well --- it
needed to be STABLE to be used in a tidscan qual, but it also needed to
be VOLATILE to prevent the planner from speculatively executing it
(resulting in premature failure if the cursor wasn't there at plan
time).  So I ended up letting the special CurrentOfExpr node type
persist all the way through to execution.  This required very minor
hackery in tidpath.c and nodeTidscan.c to accept such a node as a TID
qual; it would've taken something uglier to make the function
representation work.

One area that could still do with more work is getting the facility to
play nicely with views.  However, it's probably premature to think about
that before we have updatable views that work well...
        regards, tom lane


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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Truncate Permission
Следующее
От: Tom Lane
Дата:
Сообщение: What's with the StartDb:2 failures on skylark?