Re: Unexplainable slow down...

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Ron Snyder <snyder(at)roguewave(dot)com>
Cc: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Unexplainable slow down...
Date: 2002-03-14 03:04:28
Message-ID: 20020313190203.Q92838-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Here's an "explain":
> # explain select * from builds where product='sourcepro_db' and state != 'N'
> and state != 'W' and finished >= '03/12/2002' and finished < '03/13/2002'
> limit 15;
> NOTICE: QUERY PLAN:
>
> Limit (cost=0.00..833.71 rows=15 width=426)
> -> Seq Scan on builds (cost=0.00..123873.38 rows=2229 width=426)
>
> EXPLAIN

What's the explain for limit 14? And what if you set enable_seqscan=off?

> Here's what the table looks like:
>
> $ psql quickview pgsql72 -c "\d builds"
> Table "builds"
> Attribute | Type | Modifier
> -------------------+--------------------------+----------
> id | integer | not null
> visible | boolean |
> state | character(1) |
> evaluated | boolean |
> product | character varying(30) |
> compiler | character varying(30) |
> os | character varying(30) |
> stdlibtype | character varying(30) |
> linktype | character varying(30) |
> threadlib | character varying(30) |
> exportlevel | character varying(30) |
> usermode | character varying(30) |
> postbuildclean | character varying(30) |
> prebuildclean | character varying(30) |
> submitted | timestamp with time zone |
> started | timestamp with time zone |
> finished | timestamp with time zone |
> machine | character varying(100) |
> errors | integer |
> warnings | integer |
> testsattempted | integer |
> testspassed | integer |
> testsfailed | integer |
> examplesattempted | integer |
> examplespassed | integer |
> examplesfailed | integer |
> ping | timestamp with time zone |
> start_count | integer |
> user1 | character varying(50) |
> user2 | character varying(50) |
> user3 | character varying(50) |
> user4 | character varying(50) |
> user5 | character varying(50) |
> user6 | character varying(50) |
> debug | character varying(30) |
> Indices: builds_compiler,
> builds_machine,
> builds_os,
> builds_pkey,
> builds_product,
> builds_product_os_compiler,
> builds_product_state_finished,
> builds_product_state_submitted,
> builds_started,
> builds_vis_compiler_fin_state,
> builds_vis_compiler_submitted,
> builds_vis_machine_fin_state,
> builds_vis_machine_submitted,
> builds_vis_os_fin_state,
> builds_vis_os_submitted,
> builds_vis_prod_fin_state,
> builds_visible_product,
> builds_visible_product_submitte

Some of these indices seem obvious others I'm not sure what they're
supposed to cover.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sergio Freue 2002-03-14 03:07:54 Select not using primary key index
Previous Message Richard Emberson 2002-03-14 02:49:39 location of Large Object