Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fQLhf-0003QS-Fn for pgsql-general@arkaria.postgresql.org; Tue, 05 Jun 2018 23:49:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fQLhd-0003LK-RO for pgsql-general@arkaria.postgresql.org; Tue, 05 Jun 2018 23:49:25 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1fQLhd-0003Ks-6g for pgsql-general@lists.postgresql.org; Tue, 05 Jun 2018 23:49:25 +0000 Received: from resqmta-ch2-06v.sys.comcast.net ([2001:558:fe21:29:69:252:207:38]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fQLhZ-00067M-MU for pgsql-general@postgresql.org; Tue, 05 Jun 2018 23:49:24 +0000 Received: from resomta-ch2-01v.sys.comcast.net ([69.252.207.97]) by resqmta-ch2-06v.sys.comcast.net with ESMTP id QKoofplGIN6xcQLhTfKbKa; Tue, 05 Jun 2018 23:49:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20161114; t=1528242555; bh=j0tugbCGOXDwQ8PcP2Upkw4dgvervqsb6Js4QoCKR+8=; h=Received:Received:Received:From:To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=P2EtrMqyE5CMXLjs+uYnunsbpTX6tnSjF3yK+dvSqFwEcu6vVQWFzTC8hqVb7fW1i NZNlIE9U2pELv/6nre0xH2s87rXIrc8cRW+n3hfzcGCk4wN2M8N6iO+h7IAxYjMbUb xrIFVE1vtPgOkAm/JEFk001D8Df7b3R7jEw8xu6FTbVqMuhrHE+jYZuCFvwMKziJM9 mqTHjcTPBg2s+YaIB1eJJVXVn1ZejpHOGfIbtwLW/iK+P6/6UDthJjgaUsIB5DQfG3 J6wN91cnj/DYQvxW/jq1yTFxYvrAsvXnpoG99pfa6+rmIb72Uuz5dPdabBE056mBAT LOxFKvFJLnNzw== Received: from jsievers.comcast.net ([12.187.116.132]) by resomta-ch2-01v.sys.comcast.net with ESMTPA id QLhJfuOfowQlgQLhJfd9zc; Tue, 05 Jun 2018 23:49:13 +0000 Received: from jsievers.enova.com (localhost [127.0.0.1]) by jsievers.comcast.net (Postfix) with ESMTP id 4004C260056; Tue, 5 Jun 2018 18:49:04 -0500 (CDT) From: Jerry Sievers To: Adrian Klaver Cc: Jerry Sievers , pgsql-general@postgresql.org Subject: Re: Which backend using which pg_temp_N schema? References: <87o9go3nok.fsf@jsievers.enova.com> <81d847d2-59eb-0094-59cf-b91565213f44@aklaver.com> Date: Tue, 05 Jun 2018 18:49:04 -0500 In-Reply-To: <81d847d2-59eb-0094-59cf-b91565213f44@aklaver.com> (Adrian Klaver's message of "Tue, 5 Jun 2018 16:21:49 -0700") Message-ID: <87k1rc3ibz.fsf@jsievers.enova.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-CMAE-Envelope: MS4wfAH6MkNQauG9Af5KfY+8U1wMR64gqEQlJZyGXNuj9fgBO27uNhHHhjBHuPGepePOWN4z7kXLQpOsVUlOeIFuc/kY3HtaRUXvhgtEDlsZ1VkkFoCjcYVi vzd6qU4ED97jlJpVll5NJsG/hrNbxmy/GYWRiIKnAdoU/YQ++Qjzm9XVgs5StoYxAMXYHNpjLOlvDQGOvaMHJxNzqkozTtXA9/JcLSJRqlhxcGT/c/LB3UV5 8ZuVymB+RE1oz9cmnkH8whgZ1At2W3uHPK7V/8UmUes= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Adrian Klaver writes: > On 06/05/2018 02:53 PM, Jerry Sievers wrote: > >> Was just studying a legacy DB to learn about temp table activity. >> >> Felt like being able to tie temp schemas to live backends s/b useful but >> then didn't find a function/view for doing this. > > I don't understand what the above is getting at. > Can you explain more about what you are trying to do? Sure... A backend may or not have a pg_temp_N schema assigned to it depending whether or not it ever needs one for temp objects... Suppose we query pg_class and pg_namespace to see what temp tables exist at some particular time. We find some tables and thus have info about which role ownes them and the usual. But it's a complex and monolithic app with too many aspects all running as same role. Having a way to relate PID to such a temp schema then gives us perhaps a lot more info about the app behavior. To wit; source IP might lead us to know that this is a batching aspect of the app and not the OLTP aspect etc. Yes of course there might be folks somewhere around this organization that can answer some of those questions but IMO knowing which PID is doing temp stuff in some schema tells us a lot that I am not sure can be machine-gotten any other way. > >> >> A quic \df for functions with names likely to be fruitful revealed >> nothing. Did likewise for sysinfo views. >> >> Am I missing it or does feature not exist? >> >> Thx >> -- Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net p: 312.241.7800