How To Create MySQL Materialized Views?

Hi guys,

I’m trying to put together a complete guide regarding creation of materialized views in MySQL. I’ve been looking at various methods for achieving this.

Here’s what I have so far:

  1. Using triggers - you can set triggers on the source tables on which you build the view. This minimizes the resource usage as the refresh is only done when needed. Also, data in the materialized view is realtime-ish

  2. Using cron jobs with stored procedures or SQL scripts - refresh is done on a regular basis. You have more control as to when resources are used. Obviously you data is only as fresh as the refresh-rate allows.

  3. Using MySQL scheduled events - similar to 2, but runs inside the database

  4. Flexviews - using FlexDC mentioned by Justin. The closest thing to real materialized views.

looking forwards for feedback or proposals for other methods for creating materialized views in MySQL

thanks,
John

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.