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 1n7av2-0004wK-9I for pgsql-general@arkaria.postgresql.org; Wed, 12 Jan 2022 10:31:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n7av1-0004mC-6H for pgsql-general@arkaria.postgresql.org; Wed, 12 Jan 2022 10:31:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n7av0-0004m3-Qy for pgsql-general@lists.postgresql.org; Wed, 12 Jan 2022 10:31:50 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1n7auy-0006bS-ON for pgsql-general@lists.postgresql.org; Wed, 12 Jan 2022 10:31:50 +0000 Received: by mail-pj1-x102f.google.com with SMTP id i8-20020a17090a138800b001b3936fb375so11080361pja.1 for ; Wed, 12 Jan 2022 02:31:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=SHSsqVB2Rrt7a/+EYUSmFf44dp39LN7G75evbF7vutY=; b=WwyGkGLclw40JE0hPCHXZDcpEgtB6p8Mg1Ge8O4DJzBhMtivexeh0Dz9fqncST4Ejh zJpoobgO276+PzqHB9s8mz9WeQ7fSp0qmsIh0be9Yn/AD35Pmnb5noHNd9FpDCSxRtlu 8lTN4w5cBR9Up2KpA+fnqvRrZb49yYlLuAJ8vafWqSTWuzQo4X+t6DUujynaJDTX76oC H3LWLMG4qBNy6f/XHUR4XVUJtM0+Ji3K8o77aRSLbKMsI+eVfr/nenmrQ45BPDAvdb0Z HqKS/+/qCSd2PMI3oXzAKU37CaWhASCKR6NDi0XuRrhdJlyHFyETvXiBpvntD6hPpQ7M WRKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=SHSsqVB2Rrt7a/+EYUSmFf44dp39LN7G75evbF7vutY=; b=1ZKwnD9Q0sIg4Hdc8KxJ0BEcb8e7Y81ClIyUSus31oqn83mEoBDJaIWU+rwYnV1Kes b/mprjlBFFnlCWE8fXdChkSGgpI3nX9Eia+XKpn+JZtJRY86TN3PcrkybZ/0CrQdyQJq n4qg6lNq2baA47I0HRqLcZPI1M47EmkTBWNV/UKlbd5MAIZ0ZpOCpllrC8B5k2XdlloT 3bXereAcfHxFT0q3ABCpvHqPg0ajbQQOz6J77EAKiY4UDCbvXCN10KhWMIPi//k48AAz xvF7L6Iv7ukxWh4waGMhzwIt8Nlu6+bAjM1D1VJ5P0lSrwLVg++OPT+9n3laiB2vL4r+ OVfA== X-Gm-Message-State: AOAM530n9ALKw8cFQA7CeCf7tZU2rCNudJwPMnSW868YVXDaDLY+fI7H sD15c/NDpxaX9DBOzUWJS+M= X-Google-Smtp-Source: ABdhPJxytcvRNsMEuoDCYzC10ZMLVQdUYYuPYSNNM2G3w+/UG7rcj4YN5DiApevju7qmsntG+MwwCA== X-Received: by 2002:a05:6a00:174c:b0:4bf:31d7:8d0e with SMTP id j12-20020a056a00174c00b004bf31d78d0emr8510026pfc.49.1641983506548; Wed, 12 Jan 2022 02:31:46 -0800 (PST) Received: from jrouhaud (1-171-174-202.dynamic-ip.hinet.net. [1.171.174.202]) by smtp.gmail.com with ESMTPSA id q14sm4641618pjp.49.2022.01.12.02.31.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 02:31:46 -0800 (PST) Date: Wed, 12 Jan 2022 18:31:41 +0800 From: Julien Rouhaud To: Simon Riggs Cc: "Dirschel, Steve" , "pgsql-general@lists.postgresql.org" Subject: Re: pg_stat_statements Message-ID: <20220112103141.qf6dfobqbeezz5ls@jrouhaud> References: <20220112030315.vx3lkrvhjanxel7u@jrouhaud> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jan 12, 2022 at 10:22:38AM +0000, Simon Riggs wrote: > On Wed, 12 Jan 2022 at 03:03, Julien Rouhaud wrote: > > > > Unfortunately this is a known limitation. > > I see this as a beneficial feature. > > If the same SQL is executed against different sets of tables, each > with different indexes, probably different data, the performance could > vary dramatically and might need different tuning on each. So having > separate rows in the pg_stat_statements output makes sense. Yes, having different rows seems like a good thing. But being unable to tell which row apply to which schema is *not* a good thing. > > There were some previous discussions (e.g. [1] and [2] more recently), but I > > don't think there was a real consensus on how to solve that problem. > > To differentiate, run each schema using a different user, so you can > tell them apart. This isn't always possible. For instance, once you reach enough schema it will be problematic to do proper pooling.