X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 9D8DED1B8E9 for ; Thu, 4 Sep 2003 05:03:47 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 93554-09 for ; Thu, 4 Sep 2003 02:03:37 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 6B268D1B91B for ; Thu, 4 Sep 2003 02:03:35 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h84539jX014160; Thu, 4 Sep 2003 01:03:09 -0400 (EDT) To: nickf@ontko.com Cc: pgsql-performance@postgresql.org Subject: Re: SELECT's take a long time compared to other DBMS In-reply-to: References: Comments: In-reply-to "Nick Fankhauser" message dated "Wed, 03 Sep 2003 23:43:45 -0500" Date: Thu, 04 Sep 2003 01:03:08 -0400 Message-ID: <14159.1062651788@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/50 X-Sequence-Number: 3416 "Nick Fankhauser" writes: > This apparently wasn't the source of problem since he did an analyze anyway, > but my impression was that a fresh brand new database is exactly the > situation where an analyze is needed- ie: a batch of data has just been > loaded and stats haven't been collected yet. Indeed. But as someone else already pointed out, a seqscan is the only reasonable plan for an unqualified "SELECT whatever FROM table" query; lack of stats wouldn't deter the planner from arriving at that conclusion. My guess is that the OP is failing to account for some client-side inefficiency in absorbing a large query result. regards, tom lane