Re: Performance of MySQL IN() given a list of constants.

2010-01-15 Thread kabel
On Friday 15 January 2010 13:55:18 fsb wrote: > the example you gave would work with a range constraint: > > WHERE `bar_id` > 0 AND `bar_id` < 63 > > but i guess this is not a general solution. > > i've done exactly this kind of select using an IN constraint very often. > i've not had any trou

Re: Performance of MySQL IN() given a list of constants.

2010-01-15 Thread fsb
the example you gave would work with a range constraint: WHERE `bar_id` > 0 AND `bar_id` < 63 but i guess this is not a general solution. i've done exactly this kind of select using an IN constraint very often. i've not had any trouble with lists of a few hundred so long as i have the necessar

Performance of MySQL IN() given a list of constants.

2010-01-15 Thread kabel
I'm facing a refactor of some slow code that engages the DB pretty heavily. We're looking for a way to load arbitrary sets of rows from a table using an indexed column of decently high cardinality, and I'm not sure if IN() is a good way to do it or not. Basically, we're looking at this: CRE