sequences and "addval('myseq', value)"

Поиск
Список
Период
Сортировка
От pgsql@mohawksoft.com
Тема sequences and "addval('myseq', value)"
Дата
Msg-id 16880.24.91.171.78.1086665530.squirrel@mail.mohawksoft.com
обсуждение исходный текст
Ответы Re: sequences and "addval('myseq', value)"  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I have an idea, let me know what you all think.

rather than do:

select sum( field) from largetable

I want (need) to be able to do something like this:

select setval('myseq', select sum(field) from largetable);

and in a trigger

SELECT addval('myseq', field_size);

I have already created this function and am testing it. I basically took
"nextval" and assigned "byval" to a parameter and removed the value
caching code.

Anyway, I'm not quite getting the idea of caching sequence values. I
understand the performance benefits, but it seems problematic across
multiple backends, almost ensuring "holes" in the sequence of numbers.




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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: vacuumdb: vacuuming of database "testdonors" failed: ERROR: invalid memory alloc request size 3221225472
Следующее
От: pgsql@mohawksoft.com
Дата:
Сообщение: Re: vacuumdb: vacuuming of database "testdonors" failed: