Received: from belphigor.mcnaught.org ([216.151.155.121]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9ND3HP29202 for ; Tue, 23 Oct 2001 09:03:17 -0400 (EDT) (envelope-from doug@wireboard.com) Received: (from doug@localhost) by belphigor.mcnaught.org (8.11.6/8.9.3) id f9ND2CZ15944; Tue, 23 Oct 2001 09:02:12 -0400 X-Authentication-Warning: belphigor.mcnaught.org: doug set sender to doug@wireboard.com using -f To: Reiner Dassing Cc: pgsql-sql@postgresql.org, Josh@agliodbs.com, sszabo@megazone23.bigpanda.com, chriskl@familyhealth.com.au Subject: Re: Index of a table is not used (in any case) References: <3BD3BFE0.55FC3EC0@wettzell.ifag.de> <3BD515B0.C14FE0FB@wettzell.ifag.de> From: Doug McNaught Date: 23 Oct 2001 09:01:59 -0400 In-Reply-To: Reiner Dassing's message of "Tue, 23 Oct 2001 09:01:04 +0200" Message-ID: Lines: 30 User-Agent: Gnus/5.0806 (Gnus v5.8.6) XEmacs/21.1 (20 Minutes to Nikko) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200110/316 X-Sequence-Number: 5269 Reiner Dassing writes: > I would like to mention first, that I will use the [SQL] list for my > answers, > regarding the notice of Josh Berkus. > > Q: "did you use VACUUM ANALYZE"? > A: This table was a test bed, just using INSERTS without ANY deletes or > updates You still need to run VACUUM ANALYZE. The ANALYZE part measures the statistics of your data, which the planner needs in order to make decision. > Am afraid, that the real answer is not mentioned: > Why is the index used in the SELECT: > select * from wetter order by epoche desc; > > > select * from wetter where epoche between '1970-01-01' and '1980-01-01' > order by epoche asc; If you EXPLAIN output for these queries, someone can probably help you. -Doug -- Let us cross over the river, and rest under the shade of the trees. --T. J. Jackson, 1863