Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue of p1 #38

Open
nemfir opened this issue Jan 3, 2019 · 1 comment
Open

Issue of p1 #38

nemfir opened this issue Jan 3, 2019 · 1 comment

Comments

@nemfir
Copy link

nemfir commented Jan 3, 2019

Good evening, Nikolay. Thank you for tool.

Report P1 confused me. Where I'm wrong? t1 it my table originally, t2 is offered.

https://dbfiddle.uk/?rdbms=postgres_11&fiddle=cc993fad2ccc51ba6bd410612f920849
https://dbfiddle.uk/?rdbms=postgres_11&fiddle=099342ecdd74af9fd50f680e57f631bb

@NikolayS
Copy link
Owner

Sorry for the delay with this answer @cttr-dev.

I'm looking at t1 table and the current implementation of report p1 – here is what it shows:

 Table | Table Size |     Comment      |     Wasted *     | Suggested Columns Reorder
-------+------------+------------------+------------------+---------------------------
 t1    | 8192 bytes | Includes VARLENA | ~8 bytes (0.10%) | c1, c10, c11             +
       |            |                  |                  | c12, c13, c14            +
       |            |                  |                  | c15, c16, c17            +
       |            |                  |                  | c18, c19, c2             +
       |            |                  |                  | c20, c3, c4              +
       |            |                  |                  | c5, c6, c7               +
       |            |                  |                  | c8, c9, c0               +
       |            |                  |                  | c00
(1 row)

In this situation, I wouldn't bother with column reordering -- the forecasted "waste" is <1%, so the layout is already pretty much optimized (you're using 8-byte columns first, so no alignment padding gaps in the beginning).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants