From: Tomasz Myrta <jasiek@klaster.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Slow query
Date: Thu, 23 Jan 2003 15:43:29 +0100
Message-ID: <3E2FFF91.7020700@klaster.net> (raw)
References: <F175ILXS1eRw9QLMI1700017d12@hotmail.com>
Ricardo Javier Aranibar León wrote:
> I run Explain and this is the result:
> EXPLAIN SELECT * from simon where fecha='20030122' order by hora desc;
> NOTICE: QUERY PLAN:
> Sort (cost=57700.73..57700.73 rows=23682 width=46)
> -> Seq Scan on simon (cost=0.00..55591.05 rows=23682 width=46)
>
> and when I run explain for another table this is te result:
> EXPLAIN SELECT * from llamada where fecha='20030122' order by hora desc;
> NOTICE: QUERY PLAN:
> Sort (cost=41102.70..41102.70 rows=12413 width=82)
> -> Index Scan using fecha_lla on llamada (cost=0.00..39944.95
> rows=12413 width=82)
I'm not sure if there is much to help. You have a lots of rows in result -
23k rows and 12k rows. The problem is in output, not in query or indexing.
Do you really use such queries?
Anyway, did you vaccum analyze before testing?
Regards,
Tomasz Myrta
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jasiek@klaster.net
Subject: Re: Slow query
In-Reply-To: <3E2FFF91.7020700@klaster.net>
* 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