From: | Doug McNaught <doug(at)wireboard(dot)com> |
---|---|
To: | "Robert John Shepherd" <robert(at)reviewer(dot)co(dot)uk> |
Cc: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Queries take forever on ported database from MSSQL -> Postgresql |
Date: | 2002-10-16 13:39:34 |
Message-ID: | m3d6qazend.fsf@varsoon.wireboard.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
"Robert John Shepherd" <robert(at)reviewer(dot)co(dot)uk> writes:
[snip...]
> JOINs appear to be the worst offenders, with those on two tables or more
> crippling the box for minutes at a time. CPU usage is always 92%+ when
> trying to process these queries. Also when I run EXPLAIN on a query the
> highest cost items in the execution plan are pretty much always Seq
> Scans which don't use indexes.
Is it possible that you are being bitten by the data type promotion
issues? Eg, if you have an indexed int2 column, and a query like
select * from foo where int2col = 45;
the "45" will be treated as an int4 and the index won't be used.
Changing the WHERE clause to "where int2col = '45'" will use the
index.
This is (I think) somewhat improved in the upcoming 7.3 (now in beta)
and is slated to be mostly fixed in 7.4 IIRC.
If this is not the issue, post schemas and EXPLAIN output and someone
will likely try to help.
-Doug
From | Date | Subject | |
---|---|---|---|
Next Message | Jeff Boes | 2002-10-16 13:43:46 | Re: cannot open segment 1 of relation... |
Previous Message | Jose Antonio Leo | 2002-10-16 13:36:31 | Re: RV: bad result in a query!! hopeless |