All Products
Search
Document Center

Lindorm:Use hints to query hot data

Last Updated:Mar 19, 2024

This topic describes how to use hints in SQL statements for LindormTable to query hot data.

Prerequisites

Cold storage is enabled for your Lindorm instance. For more information, see Enable cold storage.

Usage

  • To query data only in the hot storage, you can use hints in the SQL statement to configure the _l_hot_only_(true) attribute. The following two statements provide examples on how to use hints to query data only in the hot storage:

    SELECT /*+ _l_hot_only_ */ * FROM t_test_versions_2 WHERE c1 IN (1, 2, 3);
    SELECT /*+ _l_hot_only_(true) */ * FROM t_test_versions_2 WHERE c1 IN (1, 2, 3);
  • If you configure the _l_hot_only_(false) attribute in the SQL statement or do not use hints in the SQL statement, all queried data is returned. The following two statements provide examples on how to query all data including cold and hot data:

    SELECT /*+ _l_hot_only_(false) */ * FROM t_test_versions_2 WHERE c1 IN (1, 2, 3);
    SELECT * FROM t_test_versions_2 WHERE c1 IN (1, 2, 3);
    Note

    Hints cannot be used to query only cold data.