TableScan), the instance does not read all target columns at once. Instead, it first reads the predicate columns and completes the filtering, then goes back to read the truly required non-predicate columns based on the filtering results.Column Read operator during the physical plan phase, splitting the originally single TableScan into two stages:Selection within the TableScan performs the filtering and outputs the set of row numbers for the matched rows.Column Read operator goes back to read and decompress only the non-predicate columns that have not been read yet.TopN is adjacent to TableScan: it first scans and locates the result rows based on the TopN sorting key, then materializes only the column data required for the final output.libra_enable_late_materialization. When enabled, it is set to ON.Required | Description |
Parameter Type | BOOL |
Default Value | ON |
Value Range | ON: Enable Late Materialization. OFF: Disable Late Materialization. |
Scope | Global Session |
SET_VAR Supported or Not | Supported |
-- Disable Late Materialization at the Session level.SET libra_enable_late_materialization = OFF;-- Enable Late Materialization at the Session level.SET libra_enable_late_materialization = ON;
Parameter | Type | Default Value | Description |
libra_minimum_rows_to_enable_late_materialization | INT | 8192 | Late materialization is not enabled when the estimated number of rows of a table is below this threshold. |
libra_minimum_selectivity_to_enable_late_materialization | FLOAT | 0.9 | A predicate is pushed down to TableScan for filtering only when its selectivity is lower than this threshold. |
libra_late_materialization_size_threshold | FLOAT | 0.5 | The optimization is abandoned if the ratio of the data volume read after late materialization to the original data volume exceeds this threshold. |
libra_enable_late_materialization_trace | BOOL | OFF | After it is enabled, it outputs the reasons for accepting or rejecting late materialization in logs, facilitating tuning and troubleshooting. |
SET_VAR Hint.tiflash_fastscan is set to ON, Late Materialization and Fast Scan are mutually exclusive. In this case, the instance automatically disables Late Materialization and outputs a warning. You can view the warning by using SHOW WARNINGS.libra_minimum_rows_to_enable_late_materialization threshold (default 8192).libra_minimum_selectivity_to_enable_late_materialization threshold (default 0.9), the corresponding predicate is not adopted as a filter condition for Late Materialization.EXPLAIN statement to observe whether Late Materialization is effective. When Late Materialization is effective, the Column Read operator (displayed as COLUMN READ in brief mode) appears in the execution plan, indicating that the materialization of some columns is deferred until this operator.
SET libra_enable_late_materialization_trace = ON;
libra_enable_late_materialization supports the SET_VAR Hint, which allows you to enable or disable Late Materialization within a single SQL statement without affecting other sessions or statements. An example is as follows:-- Enable Late Materialization within a single SQL statement.SELECT /*+ SET_VAR(libra_enable_late_materialization=ON) */ *FROM t WHERE c1 = 1 AND c2 = 1;-- Disable Late Materialization within a single SQL statement.SELECT /*+ SET_VAR(libra_enable_late_materialization=OFF) */ *FROM t WHERE c1 = 1 AND c2 = 1;
SET_VAR Hint supports both the ON/OFF and 1/0 notations, which are equivalent.
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan