MySQL HeatWave User Guide

5.8.7 Unload Advisor

Unload Advisor recommends tables to unload, reducing MySQL HeatWave memory usage. The recommendations are based upon when the tables were last queried.

Run Unload Advisor

For Advisor to recommend tables to unload, the tables must be loaded in MySQL HeatWave and a query history must be available.

To enable Unload Advisor, specify the auto_unload option in recommend mode. See Section 10.1.5, “HEATWAVE_ADVISOR”.

Use the exclude_list option to define a list of schemas and tables to exclude from Unload Advisor.

Use the last_queried_hours option to only recommend unloading tables that were not queried during this past number of hours. The default is 24 hours.

Set memory_gain_ascending to true to rank the unload table suggestions in ascending order based on the table size. The default is false.

Use the limit_tables option to limit the number of unload table suggestions, based on the order imposed by memory_gain_ascending. The default is 10.

Unload Advisor Examples

  • To view recommendations for tables to unload, for a particular schema:

    mysql> CALL sys.heatwave_advisor(JSON_OBJECT('auto_unload',JSON_OBJECT('mode','recommend')));
    +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Using:                                                                                                                                                                                     |
    |  "last_queried_hours": 24                                                                                                                                                                  |
    |  "memory_gain_ascending": FALSE                                                                                                                                                            |
    |  "limit_tables": 10                                                                                                                                                                        |
    | Number of excluded tables: 0                                                                                                                                                               |
    |                                                                                                                                                                                            |
    | SCHEMA                   TABLE                                                                                                                   MEMORY GAIN                   MEMORY GAIN |
    | NAME                     NAME                               REASON                                                                          (HEATWAVE NODES)                        (HOST) |
    | ---------------          -------------------------          ---------------------------------------------                      -----------------------------           ------------------- |
    | `airportdb`              `weatherdata`                      LAST QUERIED ON "2025-05-27 10:39:59"                                                 196.00 MiB                       0 bytes |
    | `airportdb`              `flight`                           LAST QUERIED ON "2025-05-28 07:17:00"                                                  24.00 MiB                       0 bytes |
    | `airportdb`              `airline`                          LAST QUERIED ON "2025-05-27 10:40:00"                                                   4.00 MiB                       0 bytes |
    | `airportdb`              `airplane`                         LAST QUERIED ON "2025-05-27 10:40:11"                                                   4.00 MiB                       0 bytes |                                                                                              |
    | ...                                                                                                                                                                                        |
    | ...                                                                                                                                                                                        |
    +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    19 rows in set (0.2171 sec)

What's Next

Learn more about Autopilot Report Table.