Search Postgresql Archives

Re: Increased storage size of jsonb in pg15

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



More information needed:

1) Table definition.

\d "DataRecords"
                Partitioned table "public.DataRecords"
   Column   |            Type             | Collation | Nullable |   Default  
------------+-----------------------------+-----------+----------+-------------
 filename   | character varying(255)      |           | not null |
 timestamp  | timestamp without time zone |           | not null |
 data       | jsonb                       |           | not null | '{}'::jsonb
 created_at | timestamp with time zone    |           | not null |
 updated_at | timestamp with time zone    |           | not null |
Partition key: RANGE ("timestamp")
Indexes:
    "DataRecords_pkey" PRIMARY KEY, btree (filename, "timestamp")
    "DataRecords_filename_updated_at_idx" btree (filename, updated_at)
Foreign-key constraints:
    "DataRecords_filename_fkey" FOREIGN KEY (filename) REFERENCES "DataFiles"(filename) ON UPDATE CASCADE ON DELETE CASCADE
Number of partitions: 97 (Use \d+ to list them.)

2) An example of reported size for the 14.? and 15.5 cases.

  Since upgrading from 14.8 to 15.5, the jsonb data that was previously written in 14.8 is reporting a smaller size than the same hourly data written after the upgrade (upgrade indicated in yellow):

  
filehourly_timestampfilename_bytestimestamp_bytesdata_filesizecreated_at_bytesupdated_at_bytes
datafile.dat2023-10-19 12:00:00238168288
datafile.dat2023-10-19 13:00:00238168788
datafile.dat2023-10-19 14:00:00238168588
datafile.dat2023-10-19 15:00:00238166888
datafile.dat2023-10-19 16:00:00238215588
datafile.dat2023-10-19 17:00:00238217888
datafile.dat2023-10-19 18:00:00238219988
datafile.dat2023-10-19 19:00:00238218788
datafile.dat2023-10-19 20:00:00238218088
datafile.dat2023-10-19 21:00:00238217688
datafile.dat2023-10-19 22:00:00238205388
datafile.dat2023-10-19 23:00:00238204388

3) Differences in the database attributes between the two instances.

  No differences.

4) Was this done on same machine? If not how are the machines different?

  Same AWS RDS Postgres instance.

5) How the upgrade was done?

  Using the AWS RDS upgrade.



On Wed, Dec 13, 2023 at 3:21 PM Adrian Klaver <adrian.klaver@xxxxxxxxxxx> wrote:
On 12/13/23 14:07, Sean Flaherty wrote:
> Hello,
>
> We are seeing an increase in the reported storage size of our jsonb
> columns (using pg_column_size) since upgrading to Postgres 15.5 from
> version 14.  The increase in size is enough to push us over the size
> threshold and more of our data to get written to the TOAST table.

More information needed:

1) Table definition.

2) An example of reported size for the 14.? and 15.5 cases.

3) Differences in the database attributes between the two instances.

4) Was this done on same machine? If not how are the machines different?

5) How the upgrade was done?


>
> I can't find any information online, is anyone aware of what would cause
> this change in storage size for essentially the same data?
>
> Kind regards,
> Sean

--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux