pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: MichaelDBA <MichaelDBA@sqlexec.com>
To: Google FezaCakir <fezacakir@gmail.com>
Cc: Campbell, Lance <lance@illinois.edu>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: Reordering the fields in a table
Date: Fri, 16 Apr 2021 15:35:57 -0400
Message-ID: <0c8b2a33-0df6-d60f-6f3b-970f5058ff59@sqlexec.com> (raw)
In-Reply-To: <6ac2c50de3403c50b87ea4e160d3f8d3f8df1892.camel@gmail.com>
References: <SN6PR11MB332652C8CA57B27E80EF9FBDDE4C9@SN6PR11MB3326.namprd11.prod.outlook.com>
	<6ac2c50de3403c50b87ea4e160d3f8d3f8df1892.camel@gmail.com>

Also, since you are reordering your table, you might want to consider 
ordering based on saving some alignment bytes per row since everything 
is aligned on an 8 byte boundary.

For instance a table with a smallint, bigint, smallint, int  would use 
24 bytes
Reordering like this would save you 8 bytes per row!
smallint, smallint, int, bigint would use 16 bytes

Regards,
Michael Vitale

Google FezaCakir wrote on 4/16/2021 2:34 PM:
> There is no way. You should drop and re-create table with your order.
> Regards.
>
> Cum, 2021-04-16 tarihinde 16:15 +0000 saatinde, Campbell, Lance yazdı:
>>
>> If there is a way to do this please let me know.
>>
>> *PostgreSQL Request*
>>
>> I would love to see an enhancement to PostgreSQL where administrators 
>> had some way to reorder the fields in their tables.  As a software 
>> developer I can easily write a tool to reorder the fields in a table 
>> if there were no foreign keys. But foreign keys throw an enormous 
>> hurdle in my way.
>>
>> *Why is this a big deal?*
>>
>> Sixteen years ago when I started working at the University of 
>> Illinois I told my boss, “if you give me thirty days I can build a 
>> platform that will allow me to cut at least 50% off of the 
>> development time of your standard internal web business app.”  I 
>> built it.  Today I personally created/manage/develop 17 services that 
>> provide over 120 million pages of web content a year.  I can jump 
>> into this infrastructure and make a change in an hour or two that 
>> would take most people weeks to change.  The one issue that causes me 
>> the most grief is the readability of tables.  When you manage 17 
>> services where you are continually tweaking the system you find the 
>> tables are very unreadable.  New fields are continually added to the 
>> bottom of tables. They are just not readable.
>>
>> The most underappreciated elements in software design is the ongoing 
>> need to be able to easily read what you are working with.  Table can 
>> really become a mess.  It would be the most amazing enhancement to be 
>> able to order the fields of any table with a command.  I know today 
>> this is probably not a top priority to most developers and DBAs.  
>> They work in an environment where one person might work on just one 
>> or two services.  But as development strategies change over time more 
>> people will be developing software faster and faster. Table field 
>> readability will become more important.
>>
>> Thanks,
>>
>> *LANCE CAMPBELL <https://directory.illinois.edu/person/lance>*
>>
>> /Software Architect/
>>
>> Web Services <https://webtools.illinois.edu/;
>>
>> Public Affairs <https://publicaffairs.illinois.edu/;
>>
>> Contact the Webtools Team <https://go.illinois.edu/contactUs;
>>
>> 217.333.0382
>>
>> lance@illinois.edu <mailto:lance@illinois.edu>
>>
>> /var/folders/wp/1f6l7hw95y718z976kgnl5f9kr5rtc/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/signature_logo.png 
>> <http://illinois.edu/;
>>
>> /Under the Illinois Freedom of Information Act any written 
>> communication to or from university employees regarding university 
>> business is a public record and may be subject to public disclosure./
>>
>

Attachments:

image.png (image/png, 2.2K) download view image

view thread (15+ messages)  latest in thread

Message-ID: <0c8b2a33-0df6-d60f-6f3b-970f5058ff59@sqlexec.com>
Permalink:  ../0c8b2a33-0df6-d60f-6f3b-970f5058ff59@sqlexec.com/
Also on:    postgresql.org/message-id/0c8b2a33-0df6-d60f-6f3b-970f5058ff59@sqlexec.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: MichaelDBA@sqlexec.com, fezacakir@gmail.com, lance@illinois.edu, pgsql-admin@lists.postgresql.org
  Subject: Re: Reordering the fields in a table
  In-Reply-To: <0c8b2a33-0df6-d60f-6f3b-970f5058ff59@sqlexec.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox