On Fri, Feb 10, 2012 at 10:38 PM, Jim Nasby <jim@nasby.net> wrote:
> On 2/7/12 8:14 AM, Alvaro Herrera wrote:
>>
>> Having one sequence for each toast table could be wasteful though. I
>> mean, sequences are not the best use of shared buffer cache currently.
>> If we could have more than one sequence data in a shared buffer page,
>> things would be different. Not sure how serious this really is.
>
>
> This would actually be an argument for supporting multiple page sizes... too
> bad that's such a beast.
>
> FWIW, from our most complex production database:
>
> cnuapp_prod@postgres08.obr=# select relkind, count(*) from pg_class group by
> 1;
> relkind | count
> ---------+-------
> S | 522
> r | 1058
> t | 698
> i | 2894
> v | 221
> c | 12
> (6 rows)
Yeh, I was thinking we would do well to implement cached sequences for
say first 1000 sequences.
That would mean we'd only use a few thousand bytes of memory rather
than 4 MB for your sequences.
Idea would be to make Sequences as fast as OIDs and get rid of the
weird OID code.
--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services