Re: [ADMIN] A query with performance problems.

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: "Fabio C(dot) Bon" <bon(at)kernel(dot)net(dot)uy>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: [ADMIN] A query with performance problems.
Date: 2003-05-06 14:39:57
Message-ID: 20030506073613.K7678-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-performance


[Moving to -performance since it's more ontopic there]

On Tue, 6 May 2003, Fabio C. Bon wrote:

> I have a database on PostgreSQL 7.2.1 and I have performance's problems with
> some queries.
> I'm debbuging the query below:
>
> Select count(*) from blcar
> where manide = 3811 and blide = 58090 and bcalupcod = 'MVDUY' and bcalopcod
> = 'LOCAL' and bcapag <> 'P';

What does the schema of the table look like?

Is the SQL query in the file exactly the same text as the above?

> Aggregate (cost=8277.10..8277.10 rows=1 width=0) (actual
> time=1273.98..1273.98 rows=1 loops=1)
> -> Seq Scan on blcar (cost=0.00..8277.09 rows=1 width=0) (actual
> time=1273.96..1273.96 rows=0 loops=1)
> Filter: (((manide)::numeric = 3811::numeric) AND ((blide)::numeric

It seems to want to coerce manide and blide to a numeric here, which seems
odd.

> = 58090::numeric) AND (bcalupcod = 'MVDUY'::bpchar) AND (bcalopcod =
> 'REPRE'::bpchar) AND (bcapag <> 'P'::bpchar))
> Total runtime: 1274.08 msec
> (4 rows)

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Robert Treat 2003-05-06 15:40:23 Re: News in 7.4
Previous Message Tom Lane 2003-05-06 14:37:24 Re: GRANT EXECUTE doesn't work?!

Browse pgsql-performance by date

  From Date Subject
Next Message Robert Treat 2003-05-06 15:33:41 Re: Hypothetical suggestions for planner, indexing
Previous Message Christopher Kings-Lynne 2003-05-06 14:04:39 Re: [PERFORM] Hypothetical suggestions for planner, indexing