Materialized views with MySQL

北战南征 提交于 2019-12-11 09:12:22

问题


Emulated materialized views with MySQL has good performance? I'm learning how to do with this link

thanks


Correction: "Materialized views" to "Emulated materialized views".


回答1:


MySQL doesn't have materialized views - the link just creates a table and stuffs data into it so the table can be indexed. That means the performance is par with a normal table, but you also have the overhead of flushing & repopulating the table (including indexes).

I didn't see what engine the table was using, but MEMORY would likely be a better choice.




回答2:


A materialized view is just a fancy name for a normal table with the data from some heavy query.

So although creating it is just as heavy as the heavy query itself, querying it is really fast.

The big question here is how you want to update the view.

  • You can do a regular full refresh. Simple to do, but heavy during that update and in between updates the data is outdated.
  • You can use triggers to automatically update the data when inserting/deleting/updating. That makes the inserts/deletes/updates for your other tables slightly heavier, but it won't be outdated.



回答3:


Flexviews (http://flexvie.ws) is an open source PHP/MySQL based project. Flexviews adds incrementally refreshable materialized views (like the materialized views in Oracle) to MySQL, usng PHP and stored procedures.

It includes FlexCDC, a PHP based change data capture utility which reads binary logs, and the Flexviews MySQL stored procedures which are used to define and maintain the views.

Flexviews supports joins (inner join only) and aggregation so it can be used to create summary tables. Moreover, you can use Flexviews in combination with Mondrian's (a ROLAP server) aggregation designer to create summary tables that the ROLAP tool can automatically use.



来源:https://stackoverflow.com/questions/3991912/materialized-views-with-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!