Re: overhead of "small" large objects - Mailing list pgsql-general

From Tom Lane
Subject Re: overhead of "small" large objects
Date
Msg-id 8256.976478761@sss.pgh.pa.us
Whole thread Raw
In response to overhead of "small" large objects  (Philip Crotwell <crotwell@seis.sc.edu>)
Responses Re: overhead of "small" large objects  (Denis Perchine <dyp@perchine.com>)
List pgsql-general
Philip Crotwell <crotwell@seis.sc.edu> writes:
> Is there significant overhead involoved in using large objects that aren't
> very large?

Yes, since each large object is a separate table in 7.0.* and before.
The allocation unit for table space is 8K, so your 10K objects chew up
16K of table space.  What's worse, each LO table has a btree index, and
the minimum size of a btree index is 16K --- so your objects take 32K
apiece.

That accounts for a factor of 3.  I'm not sure where the other 8K went.
Each LO table will require entries in pg_class, pg_attribute, pg_type,
and pg_index, plus the indexes on those tables, but that doesn't seem
like it'd amount to anything close to 8K per LO.

7.1 avoids this problem by keeping all LOs in one big table.

            regards, tom lane

pgsql-general by date:

Previous
From: Philip Crotwell
Date:
Subject: overhead of "small" large objects
Next
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Bug in index scans with Locale support enabled