I double checked the latest code:
http://github.com/dpp/liftweb/blob/master/framework/lift-persistence/lift-mapper/src/main/scala/net/liftweb/mapper/MetaMapper.scala
and it looks like there isn't a magical workaround to get IN working
as I expected.
To me, this is a violation of SQL Tuning 101: as a rule of thumb,
prefer the IN clause over an OR clause.
Is there a good reason why this code creates OR clauses instead of an
IN clause?
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
It leaves me with much to be desired since the precise issue is
unclear and limited to Postgres. (It sounds like the author might
have experienced the issue with the IN (select ...) construct which
isn't even the same thing.)
I like James Iry's idea that the final SQL would be dependent on the
database dialect (Driver, I guess). I know that different vendors
have different limits for the number of elements in an IN clause. If
we had a limit of 250, for example, but had 300 items, you could
transform it into:
where (a in (1, 2, 3, ..., 250) or a in (251, 252, ..., 300))
That would be clever (and probably necessary if the database vendor
has a relatively small number for the maximum number of IN clause
elements). I'm pretty sure that Oracle has a limit of 1,000 elements
for an IN clause, and I can't imagine requiring more than that.
For the average case (< 30 items), the IN clause is going to be easier
to read, faster to parse, and likely faster to execute on almost all
database vendors -- that is why I like it.
(I luckily don't have a large data set right now, so this won't bother
me too much.)
-------------------------------------
aw<ant...@whitford.com> wrote:
--