MySQL AI  /  ...  /  ML_MODEL_LOAD

7.1.10 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

Use ML_MODEL_ACTIVE to check which models are active for which users. All active users and models share the amount of memory defined by the shape, and it might be necessary to schedule users. ML_MODEL_LOAD generates an error if there are memory limitations.

ML_MODEL_LOAD Syntax

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

ML_MODEL_LOAD Parameters

Set the following parameters.

  • model_handle: Specifies the model handle or a session variable containing the model handle. To look up a model handle, see Query the Model Handle.

  • user: The MySQL user name of the model owner. You can set this to NULL. To learn how to share models with other users, see Grant Other Users Access to a Model.

Syntax Examples

  • An example that specifies the model handle and sets the user parameter to NULL.

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

    mysql> CALL sys.ML_MODEL_LOAD(@iris_model, NULL);
  • An example that specifies the model handle and the model owner.

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