agora inbox for postgres@postgres.berkeley.edu
help / color / mirror / Atom feedFrom: Sunay Tripathi <sunay@henna.iitd.ernet.in>
To: postgres@postgres.Berkeley.EDU
Subject: Query order
Date: Sun, 2 Apr 95 19:09:23 GMT+5:30
Message-ID: <9504021339.AA14011@henna.iitd.ernet.in> (raw)
Dear friends,
I am running postgres v4r2 on Solaris 2.3. I have a single table in which I
have 6 attributes (all of type text).
Table Name = Info
Attributes (fields) = Name Street City State Zip Country
I also have a user defined function sub_srch which takes as argument two
strings and if the search string is a sub string, it returns true.
Now, I give a simple query
* retrieve (Info.all) where Info.City="CUPERTINO" and Info.State="CA" and
sub_srch(Info.Name, "smith") \g
I want it to find all the smiths in city CUPERTINO in state CA.
Now the question -
How will the query be processed. Will all the records having Info.City =
CUPERTINO be selected first and then of those selected, it will select
the ones that have Info.State = CA and then from those the smiths or . ...
I mean, what is the order. Right now, the postgres backends first selects
all the smith by using my function and then of those selected it checks
for city and state.
For some other queries, it works in reverse order. There has to be some order
while processing the query.
I will be much obliged if anyone can give me some idea.
Thanks
Sunay Tripathi
Dept. of CSE,
IIT Delhi
==============================================================================
To add/remove yourself to/from the POSTGRES mailing list: send mail with
the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU".
If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
a human will deal with it. DO NOT post to the "postgres" mailing list.
==============================================================================
URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/
reply
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 using the --to and --cc options:
reply via email
To: postgres@postgres.berkeley.edu
Cc: sunay@henna.iitd.ernet.in
Subject: Re: Query order
In-Reply-To: <9504021339.AA14011@henna.iitd.ernet.in>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox