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 1gRkw9-0006PD-Ew for pgsql-general@arkaria.postgresql.org; Tue, 27 Nov 2018 21:30:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gRkw7-0000zq-Vk for pgsql-general@arkaria.postgresql.org; Tue, 27 Nov 2018 21:30:27 +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 1gRkw7-0000zj-Jh for pgsql-general@lists.postgresql.org; Tue, 27 Nov 2018 21:30:27 +0000 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gRkw5-0001dj-0T for pgsql-general@lists.postgresql.org; Tue, 27 Nov 2018 21:30:26 +0000 Received: by mail-pf1-x42a.google.com with SMTP id h3so9039187pfg.1 for ; Tue, 27 Nov 2018 13:30:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=Sw4yoIiUMWntDkgCr/zJxguQjn0Rtj3/RGZZdRzGh8w=; b=Tc5Yeqj8wLXYzKRxpBs4xFNJh24ob47xCqB65zuqFdZDg9/kwS2u4yXgbmdOArelZs gDoa5UZEpO7FCviPzzTpAvTNM0xyvowy45tOP1bth1KSLhga/5J8+l637+FMOxUTZM49 ClYLrnqNszRu/Wxx3Rnr+htjvPaH9L7AQHF2OQPKVkCtKWAmb+tjgt++1CkQrTWTuxdT G51okX/6D9DjGXcvbaGBODMWhqaJF0SaJxSlV/M1N4mtkregY8BB4gK691KE4zzCUujB kwdd9ZrxrHNwDF13vx8Rs4+Z0HGgBXAPYJBZlNL8dsk7y0mPaTzFqYuB0y7fQ6Ihpho7 j2ZQ== 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=Sw4yoIiUMWntDkgCr/zJxguQjn0Rtj3/RGZZdRzGh8w=; b=YM5qM1E9DOKi1rI1omWlXo6yEJs7jY33JqgllIgIjUhlbRnhC1sBta52qIWhCXg6Xv u9vQLgR/FYWVIwWUhscarbjCJNF5rnvWbhlCMgIp73J2P36CnPxwfEkuoLpwc/63Nbjx NGcfuQZZzlvEEUAfZGRiSdKxlJs//51O9ii2Pm9lPk5HPut5N814S4wkXW0J6H69MJkM Vo3LTwsjoIYscgXdf5aS9Ff7seFjtFsHN6mpF/venjOo6tZE+Yo3YaBrUonzl6AGhCGh bteLgKj2jo+S24i7h7lstW44Z7xw3Zj8yNKVDGRdIYVg759G6IlQwOfCSsI4oKOiUC7p 7/xA== X-Gm-Message-State: AA+aEWZaCj2gXc5rMAVFlUiIEUb1RVSFA6lU51KC//HGbgfzGfPTbqUu /cwAALT+LoNaHy8Z7/cxD0giIjrJ X-Google-Smtp-Source: AFSGD/VhpcKaBdKW9oowzkJsWCKIj3VDNO6j8WhnwXiMowU05M1zoudBBR0V5prV4/zLwl8vH0OIyQ== X-Received: by 2002:a63:4d66:: with SMTP id n38mr30833438pgl.270.1543354221976; Tue, 27 Nov 2018 13:30:21 -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 l3sm6330193pga.92.2018.11.27.13.30.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Nov 2018 13:30:21 -0800 (PST) Subject: Re: pg_stat_statements: can we extend the object names to the qualified names? To: Alvaro Herrera References: <20181127211721.4keykfxn66mcipdo@alvherre.pgsql> Cc: pgsql-general@lists.postgresql.org From: Sergei Agalakov Message-ID: <7878256f-3582-86c1-076d-881d9bd28374@gmail.com> Date: Tue, 27 Nov 2018 14:30:20 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <20181127211721.4keykfxn66mcipdo@alvherre.pgsql> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I like it. I don't want to break backward compatibility. The new column could be named like query_qn, and will have here the unambitious text of the query where all the objects names are extended to the qualified names. Sergei Agalakov On 11/27/2018 2:17 PM, Alvaro Herrera wrote: > On 2018-Nov-27, Sergei Agalakov wrote: > >> 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. > I think this is hard to do in a really useful manner -- if we qualify > all names in the query, it becomes mangled to the point that it's no > longer easily recognizable (users want to "grep" their applications to > see where the queries are). Maybe we can have a second column that > shows the query with all object names schema-qualified, keeping the > original one that uses the query as entered by the user. >