Ltree usage.. - Mailing list pgsql-sql

From Rajesh Kumar Mallah.
Subject Ltree usage..
Date
Msg-id 200208022203.52617.mallah@trade-india.com
Whole thread Raw
Responses Re: Ltree usage..  (Oleg Bartunov <oleg@sai.msu.su>)
List pgsql-sql
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.*' ;

also is qry3 better to Qry2 in terms of performance?

regds
mallah.



--
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.




pgsql-sql by date:

Previous
From: Wei Weng
Date:
Subject: Re: Seeking advice regarding a design problem
Next
From: Oleg Bartunov
Date:
Subject: Re: Ltree usage..