Re: views, queries, and locks

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: views, queries, and locks
Дата
Msg-id CAHyXU0zjWg1mMYpPjoCRR_t_Ex1qYgLGuZRfEYFd+Zvz+gi+Yw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: views, queries, and locks  (Jon Nelson <jnelson+pgsql@jamponi.net>)
Список pgsql-general
On Tue, Apr 3, 2012 at 1:41 PM, Jon Nelson <jnelson+pgsql@jamponi.net> wrote:
> On Tue, Apr 3, 2012 at 1:36 PM, Merlin Moncure <mmoncure@gmail.com> wrote:
>> Generally speaking, in SQL, locks are held until the transaction
>> commits; there are tons of reasons why things have to work that way.
>> Anyways, I'm betting your requirement to have to re-CREATE the view
>> can be abstracted out somehow.  I'm guessing you have some type of
>> table rotation going on?
>
> Close, but not quite. It's not rotation but every N minutes a
> newly-built table appears. I'd like that table to appear as part of
> the view as soon as possible.

How sophisticated are the queries that are touching this view?  How
much data in the tables?  If you don't need to push quals down into
the view, we can do a view wrapping function that can pick up the new
tables.

> Regarding locks: I know that's how locks usually work - but what I'm
> asking is if holding on to the lock for the view, once the view has
> been 'expanded', is necessary at all.

Unfortunately, it is.

merlin

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

Предыдущее
От: Bartosz Dmytrak
Дата:
Сообщение: Re: Re: Please help me to take a look of the erros in my functions. Thanks.
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: views, queries, and locks