Re: [HACKERS] Heh, the disappearing problem!

From: "Boersenspielteam" <boersenspiel(at)vocalweb(dot)de>
To: Karl Denninger <karl(at)mcs(dot)net>
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Heh, the disappearing problem!
Date: 1998-03-10 13:52:42
Message-ID: 199803101256.NAA16903@mail.vocalweb.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

I posted a similar problem here on Saturday. Now I had a little time
looking at the queries we send.

This is the output of PG 6.2.1

--
boersenspiel=> explain SELECT DISTINCT spieler_nr, Trans.wpk_nr,
state, anzahl, buyprice, buydate, sellprice, selldate, Kurse.wpk_nr,
name, curr, kurs, datum , Trans.oid from Trans, Kurse WHERE
Trans.wpk_nr=Kurse.wpk_nr AND spieler_nr=3 ORDER BY Trans.wpk_nr ,
selldate USING >; NOTICE:QUERY PLAN:

Unique (cost=0.00 size=0 width=0)
-> Sort (cost=4.10 size=0 width=0)
-> Nested Loop (cost=4.10 size=1 width=73)
-> Index Scan on trans (cost=2.05 size=1 width=41)
-> Index Scan on kurse (cost=2.05 size=14305 width=32)

Now the same query in 6.3:

Unique (cost=1164.21 size=0 width=0)
-> Sort (cost=1164.21 size=0 width=0)
-> Hash Join (cost=1164.21 size=1 width=73)
-> Seq Scan on kurse (cost=688.07 size=14305 width=32)
-> Hash (cost=0.00 size=0 width=0)
-> Index Scan on trans (cost=2.05 size=1
width=41)

All indices are created (all btrees), but the index on kurse doesn't
seem to be used.

> Guess what - it magically fixed itself.
>
> If you want to talk about things that *bother* me, this one tops the pack.
>
> The same query now returns an index hash query plan, which executes in a few
> seconds and requires little memory (as opposed to looped sequential scans
> requiring 500MB on the server).
>
> This is really, really, odd.

Dito.

BTW.: I tried to apply the patches from Massimo, as the only major
problem for us in 6.2.1p6 is the buggy deadlock code. Anybody managed
to get it working?

Ciao

Ulrich

Ulrich Voss \ \ / /__ / ___|__ _| |
VoCal web publishing \ \ / / _ \| | / _` | |
voss(at)vocalweb(dot)de \ V / (_) | |__| (_| | |
http://www.vocalweb.de \_/ \___/ \____\__,_|_|
Tel: 0203-306-1560 web publishing

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-03-10 14:10:06 Re: [BUGS] views with group by/count segfault
Previous Message Thomas G. Lockhart 1998-03-10 13:34:02 Re: [HACKERS] postgres/alpha problems