Materializzazione del Result Set
Sintassi
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> materializeResultSet
materializeResultSet -->| | MATERIALIZE:::quoted
MATERIALIZE --> End((END))
Scopo
Il suggerimento materialize forza la materializzazione del result set di una query. Viene tipicamente usato per migliorare le prestazioni di sottoquery non correlate, evitando il ricalcolo ripetuto dello stesso result set.
Esempi
La sottoquery su in viene eseguita una sola volta usando materialize:
select *
from ExactOnlineREST..Accounts
where Id
in
( select /*+ materialize */ AccountId
from MyCustomerTable@postgresql
)