mysql - Fast rand() order search -
we have table of 50k items , display @ search page random sort , 10 items per page. need apply filters.
rand()
or without seed slow. note items have 3 categories. first category should displayed first random order, , second category, random order.
- generating random number between 0 , max_id s not working because of pages , mentioned constraints
- randomizing records php makes items display @ same page
is there better solution speed random search?
here few tip hopes works
- put indexes on main field on filtering
- reduce number of column in select query (only use needed columns)
- recheck joins
- recheck conditions
- recheck group/having/order clause
Comments
Post a Comment