View [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]

Asked

Viewed 228 times

1

About VIEW in database... What is the difference between the three algorithms when creating a VIEW with [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]? What each one does?

1 answer

1

For UNDEFINED, Mysql chooses which algorithm to use.

It prefers MERGE over Temptable if possible, because MERGE is generally more efficient and because VIEW cannot be upgraded if a temporary table is used .

The reason for choosing Temptable explicitly is that locks can be released in underlying tables after the temporary table has been created and before being used to finish processing the declaration.

This can result in faster release of lock than the fusion algorithm so that other clients using the point of view are not blocked for that long.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.