Обсуждение: A question about pages

Поиск
Список
Период
Сортировка

A question about pages

От
tmorelli@tmorelli.com.br
Дата:
Hi,

I've been studying about how PostgreSQL uses pages (data and indexes) lately.
And, I guess, I found out a strange thing (bizarre!)

After creating a table with just one field (char(2048)), and an index, I
inserted 5 rows. But, surprisingly, my table still uses just one page! Even
having 5 x 2048  = 10.240 bytes, How could it be possible? (the page size is 8K)

I've made the test over and over. Where did I make a mistake? Looking at "ls"
information, I see that the file size is 8192 bytes

Could anyone help me?

best regards

Eduardo Morelli

Re: A question about pages

От
Tom Lane
Дата:
tmorelli@tmorelli.com.br writes:
> After creating a table with just one field (char(2048)), and an index, I
> inserted 5 rows. But, surprisingly, my table still uses just one page! Even
> having 5 x 2048  = 10.240 bytes, How could it be possible? (the page size is 8K)

> I've made the test over and over. Where did I make a mistake? Looking at "ls"
> information, I see that the file size is 8192 bytes

You didn't say what test data you used, but I'll bet it's getting
compressed, or else shoved into an out-of-line TOAST table.  See
http://www.postgresql.org/docs/8.1/static/storage-toast.html

You can use VACUUM FULL VERBOSE or contrib/pgstattuple/ to get a
lower-level view of the space usage within a table.

            regards, tom lane