Thread

  1. pg_toast_xxx table's file leak (grows indefinitely)

    PostgreSQL Bugs List <pgsql-bugs@postgresql.org> — 2000-12-27T10:48:42Z

    Ronald Tschalr (ronald@innovation.ch) reports a bug with a severity of 2
    The lower the number the more severe it is.
    
    Short Description
    pg_toast_xxx table's file leak (grows indefinitely)
    
    Long Description
    I'm using the CVS snapshot from Dec 26 2000 on
    Linux 2.2.24/glibc-2.1.3.
    
    I have a table in which frequent inserts and deletes of rows are made
    (the number of rows stays roughly constant), and most rows are around
    15K and therefore spill into pg_toast_xxx. Unfortunately, while the
    main table's file size stays stable, the associated toast-table's file
    grows indefinitely. This can be easily reproduced with a simple
    program that just inserts 1 row and then deletes it again, over and
    over. Note that a "select * from pg_toast_xxx" correctly only shows
    the number of rows around - just the associated file's size keeps
    growing with every insert even if that row is immediately deleted
    again. This leads to files of 100's of MB in a few hours for a table
    that never has more than 4 entries, each of which are less than 20K.
    
    Note that a vacuum will clean up the file, but it seems that it 
    shouldn't be necessary to have to run that every hour.
    
    
    Sample Code
    test=# create table toast_test (index int4, data bytea);
    test=# insert into toast_test values(0, '....<20K of data>...');
    test=# delete from toast_test where index = 0;
    
    Now repeat last two commands over and over.
    
    No file was uploaded with this report