View Processing Algorithms
Having follow view:
DELIMITER $$
CREATE ALGORITHM=MERGE DEFINER=
SELECT
MAX(`
`sprut_
`workflow_
`workflow_
`sprut_
FROM ((`sprut_
JOIN `workflow_results`
ON ((`sprut_
JOIN `workflow_schemes`
ON ((`workflow_
GROUP BY `workflow_
DELIMITER ;
Please attention to the fact that the ALGORITHM = MERGE in definition.
As a result, the plan of view looks as if the contents view placed into a temporary table, and then on the content WHERE done without any indexes.
EXPLAIN SELECT * FROM sprut_conclusio
WHERE id_document = '9208' AND id_stage = 2
Click here to see plan: http://
But such a plan would love to get (This plan get, when view is eleminated)
EXPLAIN SELECT
MAX(sprut_
sprut_
workflow_
workflow_
sprut_
FROM sprut_conclusio
JOIN workflow_results ON sprut_conclusio
JOIN workflow_schemes ON workflow_
WHERE id_document = '9208' AND id_stage = 2
GROUP BY workflow_
Click here to see plan: http://
Question: why ALGORITHM = MERGE, works as TEMPTABLE in my case?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- MariaDB Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Sergei Golubchik
- Solved:
- Last query:
- Last reply: