pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Franz J Fortuny <ffortuny@ivsol.com>
To: pgsql-sql@postgresql.org
Subject: Re: Speed or configuration
Date: Wed, 23 Aug 2000 11:42:29 -0500
Message-ID: <WbTo5.2892$ZU2.119403@news-west.usenetserver.com> (raw)
References: <92eo5.45146$2k1.1270827@news-west.usenetserver.com>

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
cvetda,anio,mes,sum(importe),sum(cantidad)
exis-# from venart where numart in
exis-# (select "NUMART" from pvdprcod where "NUMDEP"=7
and "NUMPRO"=108)
exis-# group by cvetda,numdep,anio,mes;
NOTICE:  QUERY PLAN:

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
width=26)
              ->  Seq Scan on venart
(cost=100000000.00..79015875283591.09 rows=790095
width=26)
                    SubPlan
                      ->  Materialize
(cost=100007942.42..100007942.42 rows=34 width=4)
                            ->  Seq Scan on pvdprcod
(cost=100000000.00..100007942.42 rows=34 width=4)

EXPLAIN

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

Best regards,

Franz J Fortuny

view thread (9+ messages)

Message-ID: <WbTo5.2892$ZU2.119403@news-west.usenetserver.com>
Permalink:  ../WbTo5.2892$ZU2.119403@news-west.usenetserver.com/
Also on:    postgresql.org/message-id/WbTo5.2892$ZU2.119403@news-west.usenetserver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: ffortuny@ivsol.com
  Subject: Re: Speed or configuration
  In-Reply-To: <WbTo5.2892$ZU2.119403@news-west.usenetserver.com>
  References: <92eo5.45146$2k1.1270827@news-west.usenetserver.com> <WbTo5.2892$ZU2.119403@news-west.usenetserver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox