mviews.rst 1.2 KB

12345678910111213141516171819
  1. Materialized Views
  2. ==================
  3. Chado is efficient as a data warehouse but queries can become slow depending on the type of query. To help simplify and speed up these queries, materialized views can be employed. For a materialized view, a new database table is created and then populated with the results of a pre-defined SQL query. This allows you to execute a much simpler and faster query on the materialized view when producing user pages. A side effect, however is redundant data, with the materialized view becoming stale if not updated regularly.
  4. Tripal provides a mechanism for populating and updating these materialized views. These can be found on the **Tripal → Data Storage → Chado -> Materialized Views** page.
  5. .. image:: ./mviews.1.png
  6. Here we see several materialized views. These were installed automatically by the Tripal Chado module. To update these views, click the **Populate** link for each one.
  7. This will submit jobs to populate the views with data. Now, run the jobs:
  8. .. code-block:: shell
  9. cd /var/www/html
  10. drush trp-run-jobs --user=administrator
  11. You can now see that all views are up-to-date on the **Materialized Views Page**. The number of rows in the view table is shown.