Performance implications of creating many, many sequences

Поиск
Список
Период
Сортировка
От Michael Gardner
Тема Performance implications of creating many, many sequences
Дата
Msg-id FB36CB57-548C-4E35-A6EC-E44735C33B3C@gmail.com
обсуждение исходный текст
Ответы Re: Performance implications of creating many, many sequences  (Rob Sargent <robjsargent@gmail.com>)
Re: Performance implications of creating many, many sequences  (Craig Ringer <craig@postnewspapers.com.au>)
Список pgsql-general
Consider the following table:

CREATE TABLE invoice (
    account_id integer NOT NULL REFERENCES account,
    invoice_number integer NOT NULL,
    UNIQUE (account_id,invoice_number));

I would like to do the equivalent of making invoice_number a serial type, but on a per-account basis. Would it be a
reasonableapproach to create a separate sequence for each individual account? Are there performance implications I
shouldknow about, given that there will be hundreds of thousands of accounts? Is there another approach I should be
lookingat instead? 

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

Предыдущее
От: sunpeng
Дата:
Сообщение: Re: how to get the height of index tree?
Следующее
От: Rob Sargent
Дата:
Сообщение: Re: Performance implications of creating many, many sequences