Does standalone postfrsql have autogrowth/ manual growth on table space?

Started by Vince McMahonover 3 years ago7 messagesgeneral
Jump to latest
#1Vince McMahon
sippingonesandzeros@gmail.com

In other databases, there is a way to preallocate the table space to allow
bulk loading of data in a well packed and continuous space.

Does psql have that auto/manual growth?

#2Ron
ronljohnsonjr@gmail.com
In reply to: Vince McMahon (#1)
Re: Does standalone postfrsql have autogrowth/ manual growth on table space?

On 10/20/22 12:19, Vince McMahon wrote:

In other databases, there is a way to preallocate the table space to allow
bulk loading of data in a well packed and continuous space.

Does psql have that auto/manual growth?

There's no pre-allocation in Postgresql.  When you run CREATE TABLE, an (I
think) 8KiB file is created; it grows as you add more data. When it hits
1GiB in size, another table is created.  And then another and another and
another, etc.

--
Angular momentum makes the world go 'round.

#3Rob Sargent
robjsargent@gmail.com
In reply to: Ron (#2)
Re: Does standalone postfrsql have autogrowth/ manual growth on table space?

On 10/20/22 11:29, Ron wrote:

On 10/20/22 12:19, Vince McMahon wrote:

In other databases, there is a way to preallocate the table space to
allow bulk loading of data in a well packed and continuous space.

Does psql have that auto/manual growth?

There's no pre-allocation in Postgresql.  When you run CREATE TABLE,
an (I think) 8KiB file is created; it grows as you add more data. When
it hits 1GiB in size, another table is created.  And then another and
another and another, etc.

Another "file" is created, I think you mean

#4Ron
ronljohnsonjr@gmail.com
In reply to: Rob Sargent (#3)
Re: Does standalone postfrsql have autogrowth/ manual growth on table space?

On 10/20/22 12:31, Rob Sargent wrote:

On 10/20/22 11:29, Ron wrote:

On 10/20/22 12:19, Vince McMahon wrote:

In other databases, there is a way to preallocate the table space to
allow bulk loading of data in a well packed and continuous space.

Does psql have that auto/manual growth?

There's no pre-allocation in Postgresql.  When you run CREATE TABLE, an
(I think) 8KiB file is created; it grows as you add more data. When it
hits 1GiB in size, another table is created. And then another and another
and another, etc.

Another "file" is created, I think you mean

Yes :D

--
Angular momentum makes the world go 'round.

#5Christophe Pettus
xof@thebuild.com
In reply to: Ron (#2)
Re: Does standalone postfrsql have autogrowth/ manual growth on table space?

On Oct 20, 2022, at 10:29, Ron <ronljohnsonjr@gmail.com> wrote:
There's no pre-allocation in Postgresql.

This is correct in that you can't say "please allocate 3GB for this table for me now." The number of pages that are added to the end of a file isn't always one though; it can allocate more based on recent activity.

#6Vince McMahon
sippingonesandzeros@gmail.com
In reply to: Christophe Pettus (#5)
Re: Does standalone postfrsql have autogrowth/ manual growth on table space?

Thanks. I guess it is time for vacuum. 😂

On Thu, Oct 20, 2022, 13:34 Christophe Pettus <xof@thebuild.com> wrote:

Show quoted text

On Oct 20, 2022, at 10:29, Ron <ronljohnsonjr@gmail.com> wrote:
There's no pre-allocation in Postgresql.

This is correct in that you can't say "please allocate 3GB for this table
for me now." The number of pages that are added to the end of a file isn't
always one though; it can allocate more based on recent activity.

#7Christophe Pettus
xof@thebuild.com
In reply to: Vince McMahon (#6)
Re: Does standalone postfrsql have autogrowth/ manual growth on table space?

On Oct 20, 2022, at 11:45, Vince McMahon <sippingonesandzeros@gmail.com> wrote:

Thanks. I guess it is time for vacuum. 😂

Ironically, vacuum is the main issue. The main reason that you can't just slap a few gigabytes onto the end of a table is that the next time vacuum runs, it will happily truncate it all away.