From: Markus Espenhain <espenhain@etes.de>
To: Postgres <pgsql-admin@postgresql.org>
Subject: SQL-Statement
Date: Thu, 13 Nov 2003 18:23:27 +0100
Message-ID: <20031113172327.GB24750@intranet.etes.de> (raw)
Hello,
sorry for my previos mail.
This was a mistake...
I have an problem with the following statement.
This one works fine and give me the results in just a few seconds.
SELECT Monatsbeitrag.lfdid, Daten.Kundennummer FROM Daten, Monatsbeitrag WHERE ((((Daten.Vetrag widerufen = 2 ) AND NOT((Daten.ewmanfrdat IS NULL ) ) ) AND (Monatsbeitrag.ID = Daten.Kundennummer ) ) AND (((Monatsbeitrag.Monat + 14 ) = '2003-10-27 00:00:00'::timestamp ) AND (Monatsbeitrag.Bezahlt = 2 ) ) ) ORDER BY Daten.Name;
When I edit the statement and delete the "NOT" before "Daten.ewmanfrdat IS NULL" the Query works over 15 Minutes.
SELECT Monatsbeitrag.lfdid, Daten.Kundennummer FROM Daten, Monatsbeitrag WHERE ((((Daten.Vetrag widerufen = 2 ) AND ((Daten.ewmanfrdat IS NULL ) ) ) AND (Monatsbeitrag.ID = Daten.Kundennummer )
) AND (((Monatsbeitrag.Monat + 14 ) = '2003-10-27 00:00:00'::timestamp ) AND (Monatsbeitrag.Bezahlt = 2 ) ) ) ORDER BY Daten.Name;
OK, to select a lot of records it works a time, but for only 350 records?
Where is my problem?
Can anybody help me please.
Regards
Markus
--
Markus Espenhain Fon: +49 (7 11) 48 90 83 - 0
ETES - EDV-Systemhaus GbR Fax: +49 (7 11) 48 90 83 - 50
Libanonstrasse 58 A * D-70184 Stuttgart Web: http://www.etes.de
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: espenhain@etes.de
Subject: Re: SQL-Statement
In-Reply-To: <20031113172327.GB24750@intranet.etes.de>
References: <20031113172327.GB24750@intranet.etes.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox