X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id E768D9DCBD4 for ; Thu, 15 Dec 2005 10:20:15 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 11738-02 for ; Thu, 15 Dec 2005 10:20:19 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from webbased16.localdomain (mail.webbased.co.uk [213.152.63.91]) by postgresql.org (Postfix) with ESMTP id DEE6B9DCBC1 for ; Thu, 15 Dec 2005 10:20:12 -0400 (AST) Received: from ibmsparks (firewall [213.152.63.90]) by webbased16.localdomain (8.11.6/8.11.6) with ESMTP id jBFEKIP28427; Thu, 15 Dec 2005 14:20:18 GMT Message-Id: <200512151420.jBFEKIP28427@webbased16.localdomain> From: "Mark Cave-Ayland" To: "'PostGIS Users Discussion'" , "'Tom Lane'" Cc: Date: Thu, 15 Dec 2005 14:20:55 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 Thread-Index: AcYBOXxvcJoeR6zRSKm3Zv2qNxeRtQANOBweAAUGUWA= In-Reply-To: <71E37EF6B7DCC1499CEA0316A2568328024BBCDA@loki.wc.globexplorer.net> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-webbased16-MailScanner-Information: Please contact the ISP for more information X-webbased16-MailScanner: Found to be clean X-MailScanner-From: m.cave-ayland@webbased.co.uk Subject: Re: [postgis-users] Is my query planner failing me,or vice versa? X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/524 X-Sequence-Number: 16345 > -----Original Message----- > From: Tom Lane [mailto:tgl@sss.pgh.pa.us] > Sent: Wed 12/14/2005 9:36 PM > To: Gregory S. Williamson > Cc: pgsql-performance@postgresql.org; PostGIS Users Discussion > Subject: Re: [PERFORM] [postgis-users] Is my query planner failing me, > or vice versa? > "Gregory S. Williamson" writes: > > Forgive the cross-posting, but I found myself wondering if might not > > be some way future way of telling the planner that a given table > > (column ?) has a high likelyhood of being TOASTed. > > What would you expect the planner to do with the information, exactly? > > We could certainly cause ANALYZE to record some estimate of this, but > I'm not too clear on what happens after that... > > regards, tom lane > > > -----Original Message----- > From: postgis-users-bounces@postgis.refractions.net [mailto:postgis-users- > bounces@postgis.refractions.net] On Behalf Of Gregory S. Williamson > Sent: 15 December 2005 12:03 > To: Tom Lane > Cc: pgsql-performance@postgresql.org; PostGIS Users Discussion > Subject: RE: [PERFORM] [postgis-users] Is my query planner failing me,or > vice versa? > > Well, what does the random_page_cost do internally ? > > I don't think I'd expect postgres to be able to *do* anything in > particular, any more than I would expect it to "do" something about slow > disk I/O or having limited cache. But it might be useful to the EXPLAIN > ANALYZE in estimating costs of retrieving such data. > > Admittedly, this is not as clear as wanting a sequential scan in > preference to indexed reads when there are either very few rows or a huge > number, but it strikes me as useful to me the DBA to have this factoid > thrust in front of me when considering why a given query is slower than I > might like. Perhaps an added time based on this factor and the > random_page_cost value, since lots of TOAST data and a high access time > would indicate to my (ignorant!) mind that retrieval would be slower, > especially over large data sets. > > Forgive my ignorance ... obviously I am but a humble user. grin. > > G As I understood from the original discussions with Markus/Tom, the problem was that the optimizer didn't consider the value of the VacAttrStats stawidth value when calculating the cost of a sequential scan. I don't know if this is still the case though - Tom will probably have a rough idea already whereas I would need to spend some time sifting through the source. However, I do know that the PostGIS statistics collector does store the average detoasted geometry size in stawidth during ANALYZE so the value is there if it can be used. Kind regards, Mark. ------------------------ WebBased Ltd 17 Research Way Plymouth PL6 8BT T: +44 (0)1752 797131 F: +44 (0)1752 791023 http://www.webbased.co.uk http://www.infomapper.com http://www.swtc.co.uk This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person.