Re: [PERFORM] Planner making wrong decisions 8.2.4. Insane cost calculations.

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Henrik Zagerholm" <henke(at)mac(dot)se>
Cc: <pgsql-performance(at)postgresql(dot)org>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: [PERFORM] Planner making wrong decisions 8.2.4. Insane cost calculations.
Date: 2007-08-06 13:07:17
Message-ID: 87abt4n75m.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

"Henrik Zagerholm" <henke(at)mac(dot)se> writes:

> Hi list,
>
> I'm having a weird acting query which simply retrieves some files stored in a db
> which are related to a specific archive and also has a size lower than 1024
> bytes.
> Explain analyze below. The first one is with seq-scan enabled and the other one
> with seq-scans disabled. The weird thing is the seq scan on tbl_file_structure
> and also the insane calculated cost of 100 000 000 on some tables.

Well the way Postgres disables a plan node type is by giving it a cost of
100,000,000. What other way did you expect it to be able to scan
tbl_filetype_suffix anyways? What indexes do you have on tbl_filetype_suffix?

And any chance you could resend this stuff without the word-wrapping?
It's pretty hard to read like this:

" -> Seq Scan on tbl_filetype_suffix
(cost=100000000.00..100000001.34 rows=14 width=8) (actual time=0.133..0.176
rows=14 loops=1)"
" Filter: (filetype_suffix_index IS
TRUE)"

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2007-08-06 13:21:37 Re: Asynchronous Query processing
Previous Message Markus Schiltknecht 2007-08-06 12:33:14 Re: invalid page header

Browse pgsql-performance by date

  From Date Subject
Next Message Henrik Zagerholm 2007-08-06 14:46:43 Re: [PERFORM] Planner making wrong decisions 8.2.4. Insane cost calculations.
Previous Message Henrik Zagerholm 2007-08-06 12:21:10 Planner making wrong decisions 8.2.4. Insane cost calculations.