Can iDBQuery query a materialized view?

Yes. iDBQuery reads a materialized view just like a table, so you can point it at pre-computed, aggregated data and get fast, cited answers in plain language. Because a materialized view stores its results on disk, queries over heavy aggregations return quickly, refreshed on whatever schedule you set.

A materialized view stores the results of a query physically, refreshing on a schedule or on demand, which makes reading it as fast as reading a table. iDBQuery queries materialized views exactly like ordinary tables — it introspects them, understands the columns, and answers questions in plain language.

This is a great pattern when you have expensive aggregations:

  • Pre-compute the heavy lifting — roll up millions of rows into a daily or hourly materialized view.
  • Point iDBQuery at the materialized view — it queries the pre-aggregated data, so answers come back quickly even over huge underlying datasets.
  • Stay cited — figures trace back to the rows in the materialized view, and you control freshness through your refresh schedule.

One thing to keep in mind: a materialized view is only as current as its last refresh. iDBQuery reads whatever the materialized view currently holds, so align your refresh cadence with how fresh your answers need to be. When you need real-time figures, point iDBQuery at the live tables or a regular view instead.

Example: a marketplace maintains a materialized view of daily GMV by category. Executives ask iDBQuery 'how did each category trend this quarter?' and get an instant, cited chart, because the heavy aggregation is already done. You choose the trade-off between speed and freshness by how you build and refresh the view.

Updated 2026-06-22