Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l5Q10-0006HO-2z for pgsql-general@arkaria.postgresql.org; Fri, 29 Jan 2021 09:24:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l5Q0x-0007CR-4h for pgsql-general@arkaria.postgresql.org; Fri, 29 Jan 2021 09:24:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l5Q0w-0007CE-5n for pgsql-general@lists.postgresql.org; Fri, 29 Jan 2021 09:24:26 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l5Q0t-0003fp-AI for pgsql-general@postgresql.org; Fri, 29 Jan 2021 09:24:24 +0000 Received: by mail-wr1-x42c.google.com with SMTP id g10so8102773wrx.1 for ; Fri, 29 Jan 2021 01:24:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=NYm4ZHlo1wItHQEGND/GC9YUr7XXhUD2QsPF5vFhhDM=; b=fP02kkp7JW6G4nrSvZphEEO1POJQOdOWAMR0JE0d0LDbkbF0IsmrwZPtqqgfjXyqKc QqhYFLI3wRRyXPJg++mcgFXBvIoP/mYaxQwqFd8Q0n77ivi6SQSdKbyE7IWDPQTgPQYj IS0x2K34WZ2v/+vuWaXrLNYwQbiMRaTYl4eJuJiTApPayqWAiJMafX6+yayk5mjFn2aK CCoNn5F7V0LP5DO6lDXYyZCmRC5Qtivsuca8LsUEcsGht6O0L1BjaOb2pynCAAIznKLB qJKZoKt3ieAVzbqzHZpZ1VLVvWGEZf/tUPBAWRC9UkbXD12Z7UW2Ebak/FIOOaXfhibv fXZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=NYm4ZHlo1wItHQEGND/GC9YUr7XXhUD2QsPF5vFhhDM=; b=LC39FyuNtv/vll+TfNrIgvp0nb2AzsRM3ED7C4jsNgTIRhLMXMGLUQCn0cv9fRS7Db qVCDBSaeYz1W6a244I5ApiHZmrvZmnzaoqPf25iCYwqQJQTwzP7722nqF5gJ6yp0U8fQ lkf2X5KtsWV9N3HwKUT9SikiKgAGphz/o3dVMmeHlJYNw4/0kI4azcT7CbjMhv7GPoti Y65A07ub7MlMEQz0jTxsHSSenJD2mjYZOmX2I2uyP7MMvuyxfK9xgtVC9hcSU7sE4yWM pz5CP0HkvP5tVL84MaPdYT4HxD4E9hJ+uiAWHYPuLkQdUpMUYptXjeK4f8ii6pnRvE2I JgIw== X-Gm-Message-State: AOAM532duJ4f9MhjQ8pp9Vd5t1asow9TB99Y6Qyic1JLS/G8MGJZlotq 0UuZrhZ42WlDfnALgcWxZBymkw== X-Google-Smtp-Source: ABdhPJxg6wTt+hRgCD18JVY7EkRDmD9+jYqGCYN+rW83la1VmZEG2WNawrObAY62TdIbe4R5RZXkYw== X-Received: by 2002:a5d:4a0d:: with SMTP id m13mr3417805wrq.395.1611912260509; Fri, 29 Jan 2021 01:24:20 -0800 (PST) Received: from localhost.localdomain (217-149-169-195.nat.highway.telekom.at. [217.149.169.195]) by smtp.gmail.com with ESMTPSA id j2sm10603187wrh.78.2021.01.29.01.24.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jan 2021 01:24:19 -0800 (PST) Message-ID: <7ab85369ae7d01b21f780d04be2bc2fe22624b5f.camel@cybertec.at> Subject: Re: AW: running vacuumlo periodically? From: Laurenz Albe To: "Zwettler Markus (OIZ)" , "pgsql-general@postgresql.org" Date: Fri, 29 Jan 2021 10:24:18 +0100 In-Reply-To: <7bd95c7b8c5d451c9c1cac538984ea0b@zuerich.ch> References: <0c6514ab0ef287b40e818280754d087d210a0164.camel@cybertec.at> <7bd95c7b8c5d451c9c1cac538984ea0b@zuerich.ch> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 2021-01-28 at 17:03 +0000, Zwettler Markus (OIZ) wrote: > We didn't recognize that an application is using large objects and didn't delete them. > Now we found >100G dead large objects within the database. :-( > > Is there any _GENERIC_ query which enables monitoring for orphaned objects (dead LO)? > > select oid from pg_largeobject_metadata m where not exists > (select 1 from ANY_EXISTING_TABLE_WITHIN_THE_DATABASE where m.oid = ANY_COLUMN_CONTAINING_OIDs); > > check_postgres.pl doesn't have any generic check for it. :-( You'll have to examine the application and see which tables reference the large objects. Looking for columns with type "oid" will help. I recommend that you add an "ON UPDATE OR DELETE" trigger that unlinks orphaned large objects. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com