NikolayS / postgres_dba

The missing set of useful tools for Postgres DBAs and all engineers
BSD 3-Clause "New" or "Revised" License
1.12k stars 115 forks source link

p1: data types with typalign=c #7

Closed NikolayS closed 6 years ago

NikolayS commented 6 years ago
create table x(a "char", b int8, c "char");

– for this table report a1 (new, from branch "alignment") gives:

 Table | Table Size | Bytes Wasted in a Row |      Wasted
-------+------------+-----------------------+------------------
 x     | 536 kB     |                       |
(3 rows)

The alignment padding here is 14 bytes, but it isn't shown.

insert into x select ' ', -2, ' ' from generate_series(1, 10000);
select get_raw_page('x',0);
...2000000000000000feffffffffffffff2000000000000000

Todo:

(reported by S B over telegram channel)

screen shot 2018-01-11 at 11 58 48
NikolayS commented 6 years ago

done, committed to alignment branch

supports "char" (aka bpchar), char(N)

screen shot 2018-01-13 at 22 07 48

not yet supported/checked:

NikolayS commented 6 years ago

merged to master