Related Documentation Download this Manual
PDF (US Ltr) - 1.7Mb
PDF (A4) - 1.7Mb

HeatWave User Guide  /  ...  /  ML_MODEL_LOAD


The ML_MODEL_LOAD routine loads a model from the model catalog. A model remains loaded until the model is unloaded using the ML_MODEL_UNLOAD routine or until HeatWave AutoML is restarted by a HeatWave Cluster restart.

As of MySQL 8.1.0, a user can only load their own model, and the user parameter is ignored.

To share models with other users, see: Section 3.13.10, “Sharing Models”.

You can load multiple models but to avoid taking up too much space in memory, the number of loaded models should be limited to three.


mysql> CALL sys.ML_MODEL_LOAD(model_handle, user);

ML_MODEL_LOAD parameters:

  • model_handle: Specifies the model handle or a session variable containing the model handle. For how to look up a model handle, see Section 3.13.8, “Model Handles”.

  • user: The MySQL user name of the model owner. Specify NULL if the model owner is the current user.

    As of MySQL 8.1.0, this parameter is ignored. It can be set to NULL.

Syntax Examples

  • An ML_MODEL_LOAD call with NULL specified, indicating that the model belongs to the user executing the ML_MODEL_LOAD call:

    mysql> CALL sys.ML_MODEL_LOAD('ml_data.iris_train_user1_1636729526', NULL);
  • An ML_MODEL_LOAD call that specifies a session variable containing the model handle:

    mysql> CALL sys.ML_MODEL_LOAD(@iris_model, NULL);
  • Before MySQL 8.1.0, an ML_MODEL_LOAD call that specifies the model owner:

    mysql> CALL sys.ML_MODEL_LOAD('ml_data.iris_train_user1_1636729526', user1);