Re: query syntax performance difference?

2007-10-13 Thread Yonik Seeley
On 10/11/07, BrendanD [EMAIL PROTECTED] wrote:
 Is there a difference in the performance for the following 2 variations on
 query syntax? The first query was a response from Solr by using a single fq
 parameter in the URL. The second query was a response from Solr by using
 separate fq parameter in the URL, one for each field.

 str name=fq
 product_is_active:true AND product_status_code:complete AND
 category_id:1001570 AND attribute_id_value_en_pair:1005758\:Elvis
 Presley
 /str

 vs:
 arr name=fq
strproduct_is_active:true/str
strproduct_status_code:complete/str
strcategory_id:1001570/str
strattribute_id_value_en_pair:1005758\:Elvis Presley/str
 /arr

 I'm just wondering if the queries get executed differently and whether it's
 better to split out each individual query into it's own statement or combine
 them using the AND operator.

If they almost always appear together, then use an AND and put them in
the same filter.
If they are relatively independent, use different filters.  Having
solr intersect a few filters is normally very fast, so independent
filters is usually fine.

-Yonik


query syntax performance difference?

2007-10-11 Thread BrendanD

Hi,

Is there a difference in the performance for the following 2 variations on
query syntax? The first query was a response from Solr by using a single fq
parameter in the URL. The second query was a response from Solr by using
separate fq parameter in the URL, one for each field.

str name=fq
product_is_active:true AND product_status_code:complete AND
category_id:1001570 AND attribute_id_value_en_pair:1005758\:Elvis
Presley
/str

vs:
arr name=fq
   strproduct_is_active:true/str
   strproduct_status_code:complete/str
   strcategory_id:1001570/str
   strattribute_id_value_en_pair:1005758\:Elvis Presley/str
/arr

I'm just wondering if the queries get executed differently and whether it's
better to split out each individual query into it's own statement or combine
them using the AND operator.

I've tested them against our production server, but I didn't want to clear
the cache and compare the results. They've already been cached, so they come
back fairly quickly (within 1ms). Although originally the first query came
back in 660 ms. The second query had already been cached.


Thanks,

Brendan


-- 
View this message in context: 
http://www.nabble.com/query-syntax-performance-difference--tf4610975.html#a13167830
Sent from the Solr - User mailing list archive at Nabble.com.