Skip to content
  • Tor Didriksen's avatar
    07b1d30e
    WL#1393 Optimizing filesort with small limit · 07b1d30e
    Tor Didriksen authored
      
    Many web customers have to do
    "SELECT ... ORDER BY non_index_column LIMIT X",
      
    When X * <Row Size> is smaller than sort_buff_size we can use
    the following algoritm to speed up the sort:
      
     - Create a queue to hold 'limit' keys.
     - Scan through the table and store the first (last if DESC) keys in the queue
     - Return values from queue
    07b1d30e
    WL#1393 Optimizing filesort with small limit
    Tor Didriksen authored
      
    Many web customers have to do
    "SELECT ... ORDER BY non_index_column LIMIT X",
      
    When X * <Row Size> is smaller than sort_buff_size we can use
    the following algoritm to speed up the sort:
      
     - Create a queue to hold 'limit' keys.
     - Scan through the table and store the first (last if DESC) keys in the queue
     - Return values from queue
Loading