Thanks, increasing the statistics did the trick:
ALTER TABLE tskjema ALTER species SET STATISTICS 999
Is there a rule of thumb to tell how to set the statistics?
Jonas:))
On 4/19/06, Martijn van Oosterhout wrote:
> On Wed, Apr 19, 2006 at 01:53:46PM +0200, Jonas Henriksen wrote:
> > Yes, expl
On Wed, Apr 19, 2006 at 01:53:46PM +0200, Jonas Henriksen wrote:
> Yes, explain analyze looks like this:
Well, incorrect statistics are definitly the culprit, look:
> " -> Index Scan using sskjema_pkey on sskjema s (cost=0.00..3868.95
> rows=9738 width=157) (actual time=104.465..208.185 rows
Yes, explain analyze looks like this:
EXPLAIN
ANALYZE
SELECT
*
FROM sskjema s inner join tskjema t using(sskjema_pkey) where
t.species::char(12) like 'TAGGMAKRELL%'::char(12)
and s.date >=20050101
"Merge Join (cost=6.02..3899.33 rows=1 width=228) (actual
time=150.274..331.782 rows=190 loops=1)"
On Wed, Apr 19, 2006 at 01:27:45PM +0200, Jonas Henriksen wrote:
> Hi,
> I have a problem with a slow query. (I have run vacuum full analyze!)
> It seems that the query below works OK because the query planner
> filters on the date first. It takes about 0.3 sec:
Can we see an EXPLAIN ANALYZE of th
Hi,
I have a problem with a slow query. (I have run vacuum full analyze!)
It seems that the query below works OK because the query planner
filters on the date first. It takes about 0.3 sec:
EXPLAIN
SELECT
*
FROM sskjema s INNER JOIN tskjema t USING(sskjema_pkey)
WHERE t.species::char(12) LIKE 'TAGG