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 1gRk7H-00043a-PG for pgsql-general@arkaria.postgresql.org; Tue, 27 Nov 2018 20:37:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gRk7F-0005Jp-Sw for pgsql-general@arkaria.postgresql.org; Tue, 27 Nov 2018 20:37:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gRk7F-0005Ji-Er for pgsql-general@lists.postgresql.org; Tue, 27 Nov 2018 20:37:53 +0000 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gRk7C-0007EE-Mr for pgsql-general@lists.postgresql.org; Tue, 27 Nov 2018 20:37:51 +0000 Received: by mail-pf1-x429.google.com with SMTP id g62so8946923pfd.12 for ; Tue, 27 Nov 2018 12:37:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=Fb3vYKXfwWhjbJNWFtloFQPjhKdzZS4S3Az0YfBp1GY=; b=HnSWf4lea+Rjtj5YDVU53QDoNUj3Z1nqX/wVtzk4BJKSyQj1KKt6xJiUtSk4zaA0OK Qyq16QB6/foKJ8mJCsxNt5VTzvBiQw9tGXnRjCbGiBYlf0etWIgkCtH1lqLDGQnzIZLZ lrVc5baQsMTR0XB/U4DUBfrm/tq8eHp3Bgteb54np41M3tu1YbxcDxg6xgOr1ohVQ0qq ynXZJEp8E/rpVAujulxw0NKrPg4ZgFU8xFUNjAvxlijJjU/CC2haBwPSgBaJez8vXlBO C12LDahWdF6gSRDkmI+x7aHwtFpe9CwnNuZ7jgc2P0g8iLrwgehMYRmRmmJh5EqSyCW1 XaBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=Fb3vYKXfwWhjbJNWFtloFQPjhKdzZS4S3Az0YfBp1GY=; b=tRdhIaQyI8cvlLXq7EAKAJfiEXrbiVtYJxZ+Y3iQ9NRUHEu5+Q54sPqJ8cFLL1/ATc eD5h1mI9bVpHlnn34omkFK76yEHx4VSeQwpHn7wP+lNJcO7E+OJkgG8L/QjOKEAVLUHx OldP66MgW6VhhIY57u6vJcIROrCHkRAjqAGJtTQKTnqy4FxlxrIDqfdnzomGLh1xzboz v8IHjBzut57gS+jVnjd1bTLhi+Bb61TcuFooad1XBL4PfvnQabuEvg4dr3D2yw5Nd48m QX93CZxSjxqTC1//jw07vJdqeyg+T3GbC8uSFLGiPQVfgac3O2xfukRsqJvVDK94GnfU iWbw== X-Gm-Message-State: AA+aEWZTh7qiU9x5a7PuylV5X9a3eHcczn5wthpBGc8CoCIk1MSwNw6n b9q+LA/Gt9xf9QzRg16fYqjRQ4UL X-Google-Smtp-Source: AFSGD/W1534NsW037Y7P+qqfOfaGY9y2IPviLDcY5JD2/3fz4A5WXL/xcvLsAWBuakBVdM6Q0xWqWA== X-Received: by 2002:a63:f34b:: with SMTP id t11mr30554243pgj.341.1543351068839; Tue, 27 Nov 2018 12:37:48 -0800 (PST) Received: from ?IPv6:2001:56a:703e:dc00:d978:e331:7a05:8d1f? (node-1w7jr9y4y5kkqrzqw3uy7ox7j.ipv6.telus.net. [2001:56a:703e:dc00:d978:e331:7a05:8d1f]) by smtp.gmail.com with ESMTPSA id f22-v6sm6225552pff.29.2018.11.27.12.37.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Nov 2018 12:37:47 -0800 (PST) To: pgsql-general@lists.postgresql.org From: Sergei Agalakov Subject: pg_stat_statements: can we extend the object names to the qualified names? Message-ID: <372d75cc-053b-1a07-948f-089408d3cd3a@gmail.com> Date: Tue, 27 Nov 2018 13:37:47 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, It would help to analyze performance issues if pg_stat_statements would extend the object names to the qualified names. Currently if we have two schemas ( say s1 and s2) with the objects with the same name ( say tables t1) then after the next executions: set schema 's1'; select count(*) from t1; // returns 10 set schema 's2'; select count(*) from t1; // returns 1000000000  we see in select queryid, query from pg_stat_statements where query like '%from t1%' something like this 3004391594 select count(*) from t1 1336375111 select count(*) from t1 We do see that the queries are different but we can't see why they are so much different in the execution time. If the pg_stat_statements module would extend the object name to the qualified names like s1.t1 and s2.t2 then we would see the report as 3004391594 select count(*) from s1.t1 1336375111 select count(*) from s2.t1 with an immediate understanding of what's going on. Obviously it would be even bigger help in the situations with the more complex queries where it will be mush more difficult to find that the query was executed with the incorrect search_path settings. Thank you, Sergei Agalakov