Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id F25129FBB90 for ; Wed, 28 Mar 2007 12:58:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 57202-03 for ; Wed, 28 Mar 2007 12:58:00 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from lists.commandprompt.com (host-254.commandprompt.net [207.173.203.254]) by postgresql.org (Postfix) with ESMTP id 25BC09FBB88 for ; Wed, 28 Mar 2007 12:58:00 -0300 (ADT) Received: from [192.168.1.5] (or-67-76-146-141.sta.embarqhsd.net [67.76.146.141]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id l2SFvwnb023090 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 28 Mar 2007 08:57:59 -0700 Message-ID: <460A9084.8070105@commandprompt.com> Date: Wed, 28 Mar 2007 08:57:56 -0700 From: "Joshua D. Drake" Organization: Command Prompt, Inc. User-Agent: Thunderbird 1.5.0.10 (X11/20070306) MIME-Version: 1.0 To: Daniel Cristian Cruz CC: pgsql-performance@postgresql.org Subject: Re: Improving performance on system catalog References: <48d0cacb0703280559g50610f2r67f189bec4185b73@mail.gmail.com> In-Reply-To: <48d0cacb0703280559g50610f2r67f189bec4185b73@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.88.5/2865/Sun Mar 18 08:27:48 2007 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Wed, 28 Mar 2007 08:57:59 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/411 X-Sequence-Number: 23816 Daniel Cristian Cruz wrote: > Hi all. > > I would like to speed up this query: > > EXPLAIN ANALYZE > SELECT > relid,schemaname,relname,seq_scan,seq_tup_read,idx_scan,idx_tup_fetch,n_tup_ins,n_tup_upd,n_tup_del > > FROM pg_stat_user_tables; > Although optimizing for 13ms is a little silly imo, you could probably gain from calling the specific query underneath instead of calling the view pg_stat_user_tables. Joshua D. Drake -- === The PostgreSQL Company: Command Prompt, Inc. === Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 Providing the most comprehensive PostgreSQL solutions since 1997 http://www.commandprompt.com/ Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate PostgreSQL Replication: http://www.commandprompt.com/products/