Random sort ( SVN:1522)

7 years 10 months ago - 7 years 10 months ago #665 by bram

This version reintroduces the random sort option for the module (_list and _items layouts ) and the component.

Using the 'rand()' function of mysql to sort is very expensive therefor the component uses different algorithms to achieve some randomness.

for both the component and the module, sorting random is actually a sort on the table field 'id' this 'id' is a md5 hash and a sort on this value gives a more or less random list of items.

For the component this list is static, it might change after a new import.

For the module the list will change, using : www.electrictoolbox.com/msyql-alternative-order-by-rand/ , and the display should be a different set of random items on each page display.

please be aware that even running this pseudo random is still relative slow for large databases

  • Posts: 1494
  • Karma: 57
  • Thank you received: 247

  • Gender: Unknown
  • Birthdate: Unknown
  • Last Edit: 7 years 10 months ago by bram.

    Please Log in to join the conversation.

    Time to create page: 0.052 seconds
    Powered by Kunena Forum