dell
dell

Reputation: 172

difference between materialized view and normal table in mysql?

I would like to know the the difference between the materialized view and normal table in mysql. Though mysql dont support materialized view but we can use flexview

currently we are processing a call detail records( cdr files) and saving the records in the table (say table A) and then we have created another table( say table B ) which will have the records from table A but grouped by records. so table B will have computed records of table A eg group by country or city.

Table A keeps on growing at the enormous size as it is saving all the cdr files And Table B is saving all the results we got from table A using a group by queries

Now my question how the materialized view can be implemented in this scenario and how it makes a difference when compared to table B in above scenario as far as the query performance is concerned.

Upvotes: 0

Views: 758

Answers (1)

spencer7593
spencer7593

Reputation: 108400

In terms of comparing query performance, a SELECT from table B vs. a SELECT from a "flewview materialized view", there will be no difference, because what flexview does is create an actual table, and maintain the contents of that table.

What is probably going to be different is how the "materialized view" table is populated. It's very likely going to be different than how you populate and maintain table B.

Depending on how flexview maintains the table, when insert/update/delete operations are occurring, there might be an impact to concurrency. i.e. a query being blocked from performing a read when the "refresh" process has rows locked.

But as far as a query against the materialized view, it won't be any different than a query pf a regular table.

Upvotes: 2

Related Questions