Given something like Tip.findAll(By(Tip.venueid, 1111), PreCache
(Tip.userid))

The PreCache query param appears to do it's preaching by generating a
query that uses IN, like so:

SELECT DISTINCT users.id, users.firstname, users.lastname FROM users
WHERE id IN (SELECT userid FROM tips  WHERE venueid = 1111 );

This is a bit concerting as I have found queries of this form to be
far less efficient (on a stock MySQL instance at least) than something
like this (which will return the same results):

SELECT DISTINCT users.id, users.firstname, users.lastname FROM users,
tips WHERE tips.userid = users.id AND tips.venueid = 1111;

Is there any particular reason that Lift is generating WHERE ... IN
queries?  Is there some way to instruct Lift to do otherwise?  If not,
should this possibly be changed?

This is somewhat related to my last post on this thread as it also
relates to WHERE ... IN queries.

http://groups.google.com/group/liftweb/browse_thread/thread/14d4a5aac48ac73d/

-harryh

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to