query-plan-1132
Change label- Query Plan as raw text
-
- Summary
-
Time Node Node (ms) Percent 0.048 100.00% ¶ Subquery Scan customer_history_archive (cost=0.0..30.86 rows=1 width=1705) (actual time=0.048..0.048 rows=0 loops=1)0.047 97.92% ¶ -> Nested Loop (cost=0.0..30.85 rows=1 width=793) (actual time=0.047..0.047 rows=0 loops=1)0.047 97.92% ¶ -> Nested Loop Left Join (cost=0.0..22.54 rows=1 width=777) (actual time=0.047..0.047 rows=0 loops=1)0.045 93.75% ¶ -> Nested Loop (cost=0.0..17.6 rows=1 width=774) (actual time=0.045..0.045 rows=0 loops=1) Join Filter: (((a.customer_entity = 1) AND ((a.person_id)::text = '130965-10016'::text)) OR (((h.guarantor_id)::text = '130965-10016'::text) AND (h.status_new = 60)))0.038 79.17% ¶ -> Nested Loop Left Join (cost=0.0..9.29 rows=1 width=708) (actual time=0.035..0.038 rows=1 loops=1)0.012 25.00% ¶ -> Seq Scan on application_archive a (cost=0.0..1.01 rows=1 width=669) (actual time=0.011..0.012 rows=1 loops=1)0.018 37.50% ¶ -> Index Scan using shop__shop_id_index on shop s (cost=0.0..8.27 rows=1 width=43) (actual time=0.016..0.018 rows=1 loops=1) Index Cond: (s.shop_id = a.shop_id)0.005 10.42% ¶ -> Index Scan using application_history_archive__application_id_index on application_history_archive h (cost=0.0..8.29 rows=1 width=74) (actual time=0.005..0.005 rows=0 loops=1) Index Cond: (h.application_id = a.application_id) Filter: ((status_new = ANY ('{40,60,65,70,100,110,115}'::integer[])) AND (status_old <> ALL ('{40,60,65,70,100,110,115}'::integer[])))0.000 0.00% ¶ -> Index Scan using system_user__user_id_index on system_user u (never executed) Index Cond: (u.user_id = h.user_id)0.000 0.00% ¶ -> Index Scan using system_user__user_id_index on system_user c (never executed) Index Cond: (c.user_id = a.creator_user_id) - Run-time
- 0.518 ms

ANALYZEto update the server's statistics.EXPLAINand interpreting its output, see the Postgres documentation, in particular theEXPLAINandANALYZEreferences pages, and Using Explain.