Hi Thuva If you call 'for' on facets results, that's a completely new Sphinx query, and so is also a completely new SQL query. I'm not quite sure how I could track common :includes arguments across each of those. I think I understand what you're asking, but the overhead it would require is not worth it, I think.
That said, if you want to have a go at implementing it, be my guest :) -- Pat On 18/04/2009, at 2:57 AM, Thuva Tharma wrote: > > First of all, here is my observation about the SQL queries when I do a > faceted search--I may be wrong. Suppose I have a model called Business > which has five facets. Then every time I do Business.facets, there > will be five SQL queries on businesses table to get the facets > information. > > Now, here is my problem. If I do Business.facets(:include > => :location), then there will be 10 queries since there will be an > extra query on locations table every time the facet information is > obtained. I want the query on locations table run only once when I > call "for" method on the results of Business.facets(:include > => :location). > > I'm not sure if I'm explaining the problem clearly. Please let me know > if you need clarification. > > Thank you in advance. > > -- Thuva Tharma > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en -~----------~----~----~----~------~----~------~--~---
