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 1pFBrd-0003eq-SY for pgsql-performance@arkaria.postgresql.org; Tue, 10 Jan 2023 10:28:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pFBrb-0004BJ-Kf for pgsql-performance@arkaria.postgresql.org; Tue, 10 Jan 2023 10:28:15 +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 1pFAtD-00077t-EF for pgsql-performance@lists.postgresql.org; Tue, 10 Jan 2023 09:25:51 +0000 Received: from out-148.mta0.migadu.com ([91.218.175.148]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pFAt9-0006LA-Ud for pgsql-performance@postgresql.org; Tue, 10 Jan 2023 09:25:50 +0000 Date: Tue, 10 Jan 2023 04:25:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spiral.sh; s=key1; t=1673342744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sOOQqy9z/pG/uii4cy3yLOUq+uLA5k5UxOJL7FDm5k8=; b=i07t6hE9I2sZuRLtyr31rRyWmO/CcsHApyEsxq8z6uhiLPbizaASPrVZZM7UtxriOWhvUj hlKDLS/P5Fx9oApHaO4p5ptys1zfDNPeQb1rbkDwHSWpD/NtFYfB8eHSVUrvpbYpE65ADn sbJvjxKMsbjo/PuS+M27XOPlW3jsvOx7d9UUKotBw3NpQGK6l+8LNoE+AaJUSwaGdz0Ktw 4+fz3eSkYEpZZL/KbRsLVeksB9Mr7QXKn4tZTmeV6cncSNdLNY7UZCEKDzCLfJOazyOIz8 KrVc4OS788VZ+4WhHtNzRufEuHCuBHY+dpa5539/7QlpOszHpqOGIWfpnlsA/A== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: spiral To: Justin Pryzby , pgsql-performance@postgresql.org Subject: Re: Advice on best way to store a large amount of data in postgresql Message-ID: <20230110042538.44cad73b@xps> In-Reply-To: <20230109175647.GB9837@telsasoft.com> References: <20230108070201.39b19d30@xps> <20230109175647.GB9837@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk (re-sending this because I forgot to use "reply all". Sorry!) On Mon, 9 Jan 2023 11:56:47 -0600 Justin Pryzby wrote: > Are you using the extended query protocol with "bind" parameters, or > are they escaped and substituted by the client library ? Our client library uses parameters, yes. "$1" is passed literally to postgres. > can you arrange your partitioning such that the things to be dropped > are all in one partition, to handle in bulk ? Unfortunately, no. Deletes are all generated from user actions - if a user deletes one message, we need to delete one single row from our database. > [...] one of the main reasons for using partitioning > How many "partitions" do you have (actually, timescale uses > inheritance) ? We have ~1600 timescaledb chunks. We could increase the chunk count. We could also stop using partitions/chunks if it would improve things. I'm currently setting up a test database without partitioning to see what the performance would look like. spiral