Top
Enterprise Postgres 17 SP1 Application Development Guide

12.2.2 Checking

Execute the SQL statement with "EXPLAIN ANALYZE" to check the following:

The following shows an example of the output result of EXPLAIN ANALYZE:

EXPLAIN ANALYZE SELECT COUNT(*) FROM test WHERE x > 10000;
                                                    QUERY PLAN                                                     
-------------------------------------------------------------------------------------------------------------------
Custom Scan (VCI Aggregate)  (cost=19403.15..19403.16 rows=1 width=0) (actual time=58.505..58.506 rows=1 loops=1)
	   Allocated Workers: 4
   ->  Custom Scan (VCI Scan) using test_x_idx on test (cost=0.00..16925.00 rows=991261 width=0) (never executed)
         Filter: (x > 10000)
Planning time: 0.151 ms
Execution time: 86.910 ms
(6 rows)

Note

A cost output by the execution plan that uses a VCI may be inaccurate. A VCI works if all or part of the best execution plan when the SQL statement was executed is replaced with an execution plan that uses a VCI. If the cost of the execution plan to be replaced is lower than a certain value (vci.cost_threshold parameter), it will not be replaced or recalculated. Therefore, the cost of the original execution plan is output as is.