Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hv65D-0008LT-Ia for pgsql-bugs@arkaria.postgresql.org; Tue, 06 Aug 2019 20:29:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hv65B-0003UG-QZ for pgsql-bugs@arkaria.postgresql.org; Tue, 06 Aug 2019 20:29:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hv65B-0003Qi-HZ for pgsql-bugs@lists.postgresql.org; Tue, 06 Aug 2019 20:29:21 +0000 Received: from mail-lj1-f193.google.com ([209.85.208.193]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hv658-00080U-Md for pgsql-bugs@lists.postgresql.org; Tue, 06 Aug 2019 20:29:21 +0000 Received: by mail-lj1-f193.google.com with SMTP id p17so83365390ljg.1 for ; Tue, 06 Aug 2019 13:29:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wmkbD55ZrKpPLBD5DPYO1yJp3KMhcXNT0qiNeo3fkfw=; b=aKnvvsYeNir3RAXWXpVaa2Mjt44P4e1FhNeUitx4kFI1/AQn7TNiLE1TelSlPzHYai f9KXhzaohTt0X2NDuSudeyPazpRNgRq1nu+wtcLNLIikM9802Fe1vX7sgFUCj9Gd01Nc ebSGwL8fBMKEtctfrGUwgRIFrbaltmRYTJgf/6ozyTXrZj42X43tnPD1EstMpLkJfBhR SEjuSqdAzu+OB7kHFwU4FznOxDRqojEvAqMSqNbNiO0hCsSDrxigD8s9JKHT7StHfTfQ K9tHAhQNWb2ZBwxtCc8CKVtiJAjF9A6r4tYGfyNpcMmuEelBX9464tQ5r06VOlx0FsoK Jahg== X-Gm-Message-State: APjAAAV5d001eAbx/leSVXFuJITOFsTGY9CR3Kq45RmiCn5aB5vFCrG8 pR2HwXdS4D5zn16+jAicfo4= X-Google-Smtp-Source: APXvYqw7atHDXxmuvmeBwYzH3GUZ6LVhXhpRJgQ1pIJiOIcakSSFXU3eGDrlYiyrUx2Pe8y7ApZwbQ== X-Received: by 2002:a2e:5c09:: with SMTP id q9mr2815320ljb.120.1565123356989; Tue, 06 Aug 2019 13:29:16 -0700 (PDT) Received: from [192.168.1.10] (dsl-hkibng22-54f8d6-97.dhcp.inet.fi. [84.248.214.97]) by smtp.gmail.com with ESMTPSA id w8sm2895572lfq.53.2019.08.06.13.29.15 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 06 Aug 2019 13:29:16 -0700 (PDT) Subject: Re: BUG #15939: Postgres database size is growing due to oraphan objects To: svnitsakaram94@gmail.com, pgsql-bugs@lists.postgresql.org, PG Bug reporting form References: <15939-7f3682021804c066@postgresql.org> From: Heikki Linnakangas Message-ID: Date: Tue, 6 Aug 2019 23:29:15 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <15939-7f3682021804c066@postgresql.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi! On 05/08/2019 11:15, PG Bug reporting form wrote: > We have SSO based web login portal. Below is the our architecture details. > > User---> Load balancer(vADC)---> Tomcat Server 7.0.19(Web Server) ---> Load > Balancer (vADC) --> > Jboss EAP 6.2(Application Server) --> Postgres 9.3 (Database) PostgreSQL 9.3 is very old, and is no longer supported. You should upgrade, although I doubt it would help with this particular problem. > Here Postgres will receive user request from jboss server for login. We > found that each time when users logged out of system orphan objects are > generating which is causing database growth. We checked our database tables > which having column type is OID/bytea. We found that there are only two > tables which is having column type OID/bytea. Surprisingly , These tables > dont have any data(Only two rows in each tables). These tables are not > generating any orphan objects(LO objects). Orphan objects are stored in > pg_largeobjects table. Due to orphan objects, size of pg_largeobject is > growing hence db so. We want to implement trigger based deletion of orphan > objects ( LO objects) . But for that we have to know which application > tables are generating orphan objects. How to identify application tables > which are generating orphan objects. Kindly guide. I don't quite understand where those Large Objects are coming from, if you're not using them in your application. Perhaps the JDBC driver is creating them behind your back? Enabling statement logging might give a clue (log_statement=all). There's a contrib module called 'vacuumlo' that might help you to clean them up, see https://www.postgresql.org/docs/current/vacuumlo.html. - Heikki