FAQ
This topic covers common issues when using the vectorized engine and its In-Memory Columnar Index (IMCI) feature in PolarDB for PostgreSQL, along with solutions.
Why do I get ERROR: access method "csi" does not exist when creating an IMCI?
Why does IMCI creation take so long?
Why does IMCI creation block writes to the original table?
Why does my IMCI not return the latest data?
By default, the vectorized engine uses eventual consistency, so queries may return slightly stale data. Work through the following checks:
-
Confirm the query is using the IMCI. For details, see Check whether a SQL statement uses an IMCI.
-
If the query uses the IMCI, the engine may be lagging behind on synchronizing row store data. Tune the related parameters to improve sync performance. For details, see Real-time performance of an IMCI.
-
Enable strong consistency read to ensure the IMCI is fully synchronized before results are returned. For details, see Query consistency level.
Enabling strong consistency can reduce query performance under heavy write loads. See Why does query performance decrease after enabling strong consistency? for how to handle this trade-off.
Why does query performance decrease after enabling strong consistency?
Strong consistency requires the IMCI to be fully synchronized with the row store before returning results. If the row store table has heavy write loads and sync cannot keep up, queries wait longer.
-
Confirm the query is using the IMCI. For details, see Check whether a SQL statement uses an IMCI.
-
Tune the synchronization parameters to improve sync throughput. For details, see Real-time performance of an IMCI.
-
If write pressure is too high and sync performance still cannot meet your requirements, switch back to eventual consistency:
SET polar_csi.forward_replay_wait = off;
Why can't I use the vectorized engine and IMCI to accelerate my queries?
How does the vectorized engine relate to the ePQ feature?
They use different technologies and serve different purposes.
The Elastic Parallel Query (ePQ) feature of PolarDB for PostgreSQL is built on the cloud-native one-primary-multiple-read-only-node architecture. It distributes a single query across all read-only nodes for execution, so the ePQ feature of PolarDB for PostgreSQL has stronger scale out capabilities than native PostgreSQL, which is limited to the computing resources of one node.
The IMCI of PolarDB for PostgreSQL and ePQ are not the same technology. The IMCI improves computing efficiency on the same hardware, while ePQ aims to fully utilize all resources of the database cluster. The two features complement each other.