From: Oleg Bartunov <oleg@sai.msu.su>
To: Rajesh Kumar Mallah. <mallah@trade-india.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Ltree usage..
Date: Fri, 2 Aug 2002 20:00:38 +0300 (GMT)
Message-ID: <Pine.GSO.4.44.0208021956550.17250-100000@ra.sai.msu.su> (raw)
In-Reply-To: <200208022203.52617.mallah@trade-india.com>
On Fri, 2 Aug 2002, Rajesh Kumar Mallah. wrote:
>
> Hi Oleg,
>
> I am trying to use contrib/ltree for one of my applications.
>
> the query below works fine for me.
>
> Qry1: SELECT path from unified_data where path ~ '*.180.*' and path ~ '*.1.*';
>
> is there any way of compacting it for example
>
> Qry2: SELECT path from unified_data where path ~ '*.180.*' or path ~ '*.1.*'; is better
> written as
> Qry3: SELECT path from unified_data where path ~ '*.180|1.*' ;
Qry2 and Qry3 are equvalent and Qry3 is faster but not much.
But Qry1 is not the same as Qry2 !!!
Qry1 could be rewritten as:
SELECT path from unified_data where path @ '180 & 1';
>
> also is qry3 better to Qry2 in terms of performance?
>
> regds
> mallah.
>
>
>
>
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83
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-sql@postgresql.org
Cc: oleg@sai.msu.su, mallah@trade-india.com
Subject: Re: Ltree usage..
In-Reply-To: <Pine.GSO.4.44.0208021956550.17250-100000@ra.sai.msu.su>
References: <200208022203.52617.mallah@trade-india.com> <Pine.GSO.4.44.0208021956550.17250-100000@ra.sai.msu.su>
* 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