Re: Unexplainable slow down... - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Unexplainable slow down...
Date
Msg-id 20020313190203.Q92838-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Unexplainable slow down...  (Ron Snyder <snyder@roguewave.com>)
List 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.


pgsql-general by date:

Previous
From: "Artigas, Ricardo Y."
Date:
Subject: Re: Standby databases
Next
From: Steve Lane
Date:
Subject: Re: Last Insert