Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 432F7632795 for ; Thu, 24 Jun 2010 20:55:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 60618-09 for ; Thu, 24 Jun 2010 23:55:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id EABAC6326BC for ; Thu, 24 Jun 2010 20:55:12 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id E91EE348034; Thu, 24 Jun 2010 16:55:05 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at commandprompt.com Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z0iOcGzE-VYf; Thu, 24 Jun 2010 16:55:03 -0700 (PDT) Received: from perhan.alvh.no-ip.org (190-95-17-80.bk17-dsl.surnet.cl [190.95.17.80]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 8583A348002; Thu, 24 Jun 2010 16:55:03 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 2812C6E7F2; Thu, 24 Jun 2010 19:55:01 -0400 (CLT) Content-Type: text/plain; charset=UTF-8 Cc: pgsql-performance Subject: Re: System tables screwed up? (WAS requested shared memory size overflows size_t) From: Alvaro Herrera To: Craig James In-reply-to: <4C23E93C.7010504@emolecules.com> References: <584872.74177.qm@web39702.mail.mud.yahoo.com> <4C167A8D.1060002@gmail.com> <4C16B97F.4080201@gmail.com> <4C1A96A2.2050607@2ndquadrant.com> <4C1AB3C3.9090606@gmail.com> <20100618124826.GW23529@aart.is.rice.edu> <4C1BB6E9.1090105@2ndquadrant.com> <4C23E424.8040605@emolecules.com> <1277421485-sup-3743@alvh.no-ip.org> <4C23E93C.7010504@emolecules.com> Date: Thu, 24 Jun 2010 19:55:01 -0400 Message-Id: <1277423407-sup-289@alvh.no-ip.org> User-Agent: Sup/0.11 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201006/452 X-Sequence-Number: 39308 Excerpts from Craig James's message of jue jun 24 19:24:44 -0400 2010: > On 6/24/10 4:19 PM, Alvaro Herrera wrote: > > Excerpts from Craig James's message of jue jun 24 19:03:00 -0400 2010: > > > >> select relname, pg_relation_size(relname) from pg_class > >> where pg_get_userbyid(relowner) = 'emol_warehouse_1' > >> and relname not like 'pg_%' > >> order by pg_relation_size(relname) desc; > >> ERROR: relation "rownum_temp" does not exist > >> > >> emol_warehouse_1=> select relname from pg_class where relname = 'rownum_temp'; > >> relname > >> ---------------------- > >> rownum_temp > >> (1 row) > > > > What's the full row? I'd just add a "WHERE relkind = 'r'" to the above > > query anyway. > > Thanks, in fact that works. But my concern is that these are system tables and system functions and yet they seem to be confused. I've used this query dozens of times and never seen this behavior before. It makes me really nervous... I think you're being bitten by lack of schema qualification. Perhaps you ought to pass pg_class.oid to pg_relation_size instead of relname. What did you do to make pg_relation_size to work on type name? Why is this a -performance question anyway? -- Álvaro Herrera The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support