Databases are funny things, their behaviour behaviour has surprised me in the past. It wouldn't surprise me if they've optimized multikey behaviour so that the order doesn't matter.
I suspect that if you tried to benchmark it the difference would be lost in the noise. However, given that a change would only affect new indices, I'd be willing to make the switch if you benchmarked it. Bryan On Fri, Jan 25, 2013 at 6:54 AM, Yannick Chevalier <[email protected]> wrote: > Hi all, > > I have seen that at line 99 of: > https://github.com/tablatom/hobo/blob/master/hobo_fields/lib/hobo_fields/model.rb > the index created for a polymorphic association is in the order (type, id). > However, > I believe that it would be more efficient to index first with the id, so > that only a few records > would match. > Is it some ActiveRecord voodoo that reorders them on the fly, or is there > other considerations ? > > Bests, > Yannick > > -- > You received this message because you are subscribed to the Google Groups > "Hobo Users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > Visit this group at http://groups.google.com/group/hobousers?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "Hobo Users" 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/hobousers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
