On 11/18/06, Tom Smith <[EMAIL PROTECTED]> wrote: > > Hello. > > When in mysql I do a... > > explain select title from burningahole_product where ( price >10 and > price<20) order by random_number limit 10;
This isn't a Django question, but indexes only work well when there's a large distribution of values. If lots of your products are in that price range, you're still ordering by loads of randoms. Try assigning (as a column value) a random integer to each product, index that column, and select product where random_value in (...10 randomly generated numbers). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---