Re: Strange select query - Mailing list pgsql-general

From Partyka Robert
Subject Re: Strange select query
Date
Msg-id 3B9F43F5.10584.92CC96@localhost
Whole thread Raw
In response to Re: Strange select query  (Einar Karttunen <ekarttun@cs.Helsinki.FI>)
List pgsql-general
Hello

> The query is valid you should get more ram or rethink your query :-)
thx for explain how meny records it will return,
I know that was my mistake because the correct query I need was
something like:

select * from TA as a, TB as b, TC as c where
(position('some text' in a.textfield)>0 and a.index=b.referencefield
and b.other_referencefield=c.index) or
(position('some text' in b.textfield)>0 and a.index=b.referencefield
and b.other_referencefield=c.index)
or
(position('some text' in c.textfield)>0 and a.index=b.referencefield
and b.other_referencefield=c.index);

I was just wonder if that was bad query and take never ending loop
in backend or just return so many records.
In fact i should get this reflection self ... so maybe it was brain lock
that I dont saw this explanation (sig 'take some rest' from brain? ;-)
). I was suggested by result show by psql (I saw one the same
record showed about 100 times before I ^C the query so i think 'oh.
its probably never ending loop.').

regards
Robert Partyka

pgsql-general by date:

Previous
From: Einar Karttunen
Date:
Subject: Re: Strange select query
Next
From: "Thurstan R. McDougle"
Date:
Subject: Re: USA Disaster