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 1lUXfK-0002sD-CL for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Apr 2021 16:37:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lUXfJ-0002GN-5S for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Apr 2021 16:37:57 +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 1lUXfI-0002Ep-Rt for pgsql-hackers@lists.postgresql.org; Thu, 08 Apr 2021 16:37:56 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lUXfC-0007LB-HS for pgsql-hackers@lists.postgresql.org; Thu, 08 Apr 2021 16:37:56 +0000 Received: by mail-pg1-x535.google.com with SMTP id h25so1796192pgm.3 for ; Thu, 08 Apr 2021 09:37:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=OcUfGlZnkK0nIB+gl1wR26IYEvPugmoMvQKn/S7KoLY=; b=EI1Sbcd6TInSRoagDrg1G4bmAb55OzzVqpXHXGuagfIflcJWgjjEhoro3nkDb30o6h 4GCH0hXWAIu5TaL+drgHL3b8Rx6N2CksF+v66arPVo8kfBqYjghrmx7wZWRo/dsi1KMo sDQnh/1B8LBJlFxvDH8t28vR5ErED4kHVhQHtjn/vRwPffcODxtxe3LO/bAMqEOalQcn 8FRHX2clWJdIsH6yPcwuWixaLsroU06f090PGybvV/cchOzj/oICFB++Yr+yMWSsiK6O tE+Js4CoVHEJehjdw7DPA42CjiRdvpg++XzKtBOryXGZVxRAqgzfdOOqPYoMD+Y9ONPA SFTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=OcUfGlZnkK0nIB+gl1wR26IYEvPugmoMvQKn/S7KoLY=; b=RbZiRGQp1k3dwvUpV1jHaqOdaqer0E2twg9RUnnS2OiszotBcbUgF/JAsWw2q89q1V DPvKtkC7Tvd0MjLdiNoBWwK6JgcKVffF9iWFiKHYcIAm+xcx4e+cKD8mTaTzJ/A6AuDR WIXETrAmLvhgXvOUWwFusAXoDZkiTTOSZB7IHo/vAQbb1D3UgrLny5qLzJl2RtP4zPF5 4zMFAG7qDyO+onkbhY/jq1AYhImM2QEPhEMMIlEVbgcB/u+QO3FY2tcSeAOkmpnwFSAQ 4BOBx2UAxM1uTCUazLrb4hbrn4I8biMO1k8AuAkwrsPcjiaqpDMYc55cROC2ty+Cm/t+ qj6A== X-Gm-Message-State: AOAM531WQYdD9xlIJw7WcJ3E+aBVQwTkiUwFxSGU7QNSpTLAdks/0p8S Gt14Lib5HIO7hskqQ19vASo= X-Google-Smtp-Source: ABdhPJzQ2krcQnAkqYdQlyg7Ntj7MBYPOCa+gGiizcPbE/Q09chyrJOvrT6hWVEtlepJTcjXGCG4Rg== X-Received: by 2002:a63:4652:: with SMTP id v18mr317890pgk.386.1617899868193; Thu, 08 Apr 2021 09:37:48 -0700 (PDT) Received: from nol (2001-b011-0008-9647-4c71-2a6f-a895-f450.dynamic-ip6.hinet.net. [2001:b011:8:9647:4c71:2a6f:a895:f450]) by smtp.gmail.com with ESMTPSA id t18sm18010pfh.57.2021.04.08.09.37.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 09:37:47 -0700 (PDT) Date: Fri, 9 Apr 2021 00:38:29 +0800 From: Julien Rouhaud To: Bruce Momjian Cc: Alvaro Herrera , Tom Lane , Nitin Jadhav , Hannu Krosing , Robert Haas , Pavel Stehule , Michael Paquier , torikoshia , Atsushi Torikoshi , Tatsuro Yamada , Tomas Vondra , Evgeny Efimkin , PostgreSQL Hackers Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view? Message-ID: <20210408163829.o37wgnsrwdbrew4u@nol> References: <20210408024229.GJ24239@momjian.us> <20210408032704.GA7498@alvherre.pgsql> <20210408153425.GC2439@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210408153425.GC2439@momjian.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Apr 08, 2021 at 11:34:25AM -0400, Bruce Momjian wrote: > > OK, let's get some details. First, pg_stat_statements.queryid already > exists (no underscore), and I don't think anyone wants to change that. > > pg_stat_activity.queryid is new, but I can imagine cases where you would > join pg_stat_activity to pg_stat_statements to get an estimate of how > long the query will take --- having one using an underscore and another > one not seems odd. Indeed, and also being able to join with a USING clause rather than an ON could also save some keystrokes. But unfortunately, we already have (userid, dbid) on pg_stat_statements side vs (usesysid, datid) on pg_stat_activity side, so this unfortunately won't fix all the oddities.