I would expect this to be a very common operation in relational dbs, since 
one often looks up rows by some related table, like

select * from x where x.id in (select y.x_id from y where y.foo ...) 

It might be posts by users with certain attributes, for example.

You could write it as a join, instead, but that's often much slower, 
perhaps because it joins the whole table before apply the "where" criteria.

On Monday, October 7, 2013 7:47:40 AM UTC-7, Noel Grandin wrote:
>
>
> On 2013-10-07 16:39, Brian Craft wrote: 
> > Regarding the normal range of an IN query, what other way would you 
> > write a query that retrieves hundreds of rows by their keys? 
>
> That's a good point, there really isn't any other way. 
>
> I don't normally do that kind of thing, so that's not normally a problem 
> for me :-) 
>
> But I know from mucking around in our IN query code that we normally 
> generate a table scan for that kind of thing. 
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to