Re: Why could different data in a table be processed with different performance?

From: Fabio Pardi <f(dot)pardi(at)portavita(dot)eu>
To: Vladimir Ryabtsev <greatvovan(at)gmail(dot)com>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Why could different data in a table be processed with different performance?
Date: 2018-09-28 14:15:47
Message-ID: 510f9dd9-fe9b-9158-3fe9-1ecbd17398be@portavita.eu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 28/09/18 11:56, Vladimir Ryabtsev wrote:
>
> > It could affect space storage, for the smaller blocks.
> But at which extent? As I understand it is not something about "alignment" to block size for rows? Is it only low-level IO thing with datafiles?
>

Maybe 'for the smaller blocks' was not very meaningful.
What i mean is 'in terms of wasted disk space: '

In an example:

create table test_space (i int);

empty table:

select pg_total_relation_size('test_space');
 pg_total_relation_size
------------------------
                      0
(1 row)

insert one single record:

insert into test_space values (1);

select pg_total_relation_size('test_space');
 pg_total_relation_size
------------------------
                   8192

select pg_relation_filepath('test_space');
 pg_relation_filepath
----------------------
 base/16384/179329

ls -alh base/16384/179329
-rw------- 1 postgres postgres 8.0K Sep 28 16:09 base/16384/179329

That means, if your block size was bigger, then you would have bigger space allocated for one single record.

regards,

fabio aprdi

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Vladimir Ryabtsev 2018-09-28 19:51:03 Re: Why could different data in a table be processed with different performance?
Previous Message David Rowley 2018-09-28 10:32:49 Re: To keep indexes in memory, is large enough effective_cache_size enough?