[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)