Skip site navigation (1) Skip section navigation (2)

Re: Speed or configuration

From: "Franz J Fortuny" <ffortuny(at)ivsol(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Speed or configuration
Date: 2000-08-23 16:42:29
Message-ID: WbTo5.2892$ (view raw or flat)
Lists: pgsql-sql
Any light on this subject?

The Hermit Hacker wrote:

"use cut-n-paste please, and send us the results of the
EXPLAIN ... stuff
like the cost estimates and whatnot tell us *so* much

This is it:

exis=# \d pvdprcod
 NUMART    | integer     | not null
 NUMDEP    | smallint    | not null
 NUMPRO    | smallint    | not null
 MODELO    | varchar(20) | not null
 TALLA     | varchar(4)  | not null
 COLOR     | varchar(3)  | not null

exis=# \d venart
 cvetda    | smallint   | not null
 numdep    | smallint   | not null
 numart    | integer    | not null
 mes       | smallint   | not null
 anio      | integer    | not null
 tipotr    | varchar(2) |
 importe   | float8     |
 cantidad  | float8     |

exis=# explain select
exis-# from venart where numart in
exis-# (select "NUMART" from pvdprcod where "NUMDEP"=7
and "NUMPRO"=108)
exis-# group by cvetda,numdep,anio,mes;

Aggregate  (cost=79015875401357.48..79015875413208.91
rows=79010 width=26)
  ->  Group  (cost=79015875401357.48..79015875409258.44
rows=790095 width=26)
        ->  Sort
(cost=79015875401357.48..79015875401357.48 rows=790095
              ->  Seq Scan on venart
(cost=100000000.00..79015875283591.09 rows=790095
                      ->  Materialize
(cost=100007942.42..100007942.42 rows=34 width=4)
                            ->  Seq Scan on pvdprcod
(cost=100000000.00..100007942.42 rows=34 width=4)


Why Seq Scan if indexes have been created on the
columns used for access?

Best regards,

Franz J Fortuny

In response to

pgsql-sql by date

Next:From: Jie LiangDate: 2000-08-23 16:46:59
Subject: Re: Create table in functions
Previous:From: Tom LaneDate: 2000-08-23 15:31:06
Subject: Re: Create table in functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group