| From: | Oleg Bartunov <oleg(at)sai(dot)msu(dot)su> |
|---|---|
| To: | "Rajesh Kumar Mallah(dot)" <mallah(at)trade-india(dot)com> |
| Cc: | pgsql-sql(at)postgresql(dot)org |
| Subject: | Re: Ltree usage.. |
| Date: | 2002-08-02 17:00:38 |
| Message-ID: | Pine.GSO.4.44.0208021956550.17250-100000@ra.sai.msu.su |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
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(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Adam Erickson | 2002-08-02 18:20:34 | Aggregates and Indexes |
| Previous Message | Rajesh Kumar Mallah. | 2002-08-02 16:33:52 | Ltree usage.. |