Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save userrails/d93d5a37c089b00eaf1ec062296fa581 to your computer and use it in GitHub Desktop.
Save userrails/d93d5a37c089b00eaf1ec062296fa581 to your computer and use it in GitHub Desktop.
po_lists_performance_explain_analyze
1.	Limit (cost=2601.98..2602.12 rows=19 width=12) (actual=7484.945..8923.432 rows=57 loops=1)	0.01 ms	8923.432 ms	↓ 3	57	19	1
2.	Unique (cost=2601.98..2602.12 rows=19 width=12) (actual=7484.943..8923.423 rows=57 loops=1)	617.708 ms	8923.423 ms	↓ 3	57	19	1
3.	Sort (cost=2601.98..2602.03 rows=19 width=12) (actual=7484.943..8305.716 rows=18188180 loops=1)	4130.549 ms	8305.716 ms	↓ 957272.64	18188180	19	1
4.	Nested Loop Left Join (cost=3.44..2601.58 rows=19 width=12) (actual=0.156..4175.168 rows=18188180 loops=1)	692.751 ms	4175.168 ms	↓ 957272.64	18188180	19	1
5.	Nested Loop Left Join (cost=3..2554.34 rows=5 width=12) (actual=0.145..884.039 rows=1299189 loops=1)	-16.11 ms	884.039 ms	↓ 259837.8	1299189	5	1
6.	Nested Loop Left Join (cost=2.57..2517.42 rows=4 width=12) (actual=0.133..112.587 rows=787562 loops=1)	28.781 ms	112.587 ms	↓ 196890.5	787562	4	1
7.	Nested Loop Left Join (cost=2.15..2500.85 rows=4 width=12) (actual=0.12..26.704 rows=19034 loops=1)	-1.817 ms	26.704 ms	↓ 4758.5	19034	4	1
8.	Nested Loop Left Join (cost=1.72..2492.49 rows=4 width=16) (actual=0.06..9.487 rows=19034 loops=1)	1.396 ms	9.487 ms	↓ 4758.5	19034	4	1
9.	Nested Loop Inner Join (cost=1.29..2462.57 rows=1 width=12) (actual=0.045..1.813 rows=273 loops=1)	0.056 ms	1.813 ms	↓ 273	273	1	1
10.	Nested Loop Inner Join (cost=0.86..2454.12 rows=1 width=16) (actual=0.033..1.211 rows=273 loops=1)	0.131 ms	1.211 ms	↓ 273	273	1	1
11.	Index Scan using index_purchase_order_items_on_budget_id on public.purchase_order_items as purchase_order_items (cost=0.43..453.51 rows=238 width=8) (actual=0.013..0.261 rows=273 loops=1)
Filter: (purchase_order_items.deleted_at IS NULL)
Index Cond: (purchase_order_items.budget_id = 891016)
Rows Removed by Filter: 3
0.261 ms	0.261 ms	↓ 1.15	273	238	1
12.	Index Scan using purchase_orders_pkey on public.purchase_orders as purchase_orders (cost=0.43..8.41 rows=1 width=28) (actual=0.003..0.003 rows=1 loops=273)
Filter: ((purchase_orders.deleted_at IS NULL) AND (NOT purchase_orders.archived) AND (purchase_orders.company_id = 33909) AND (purchase_orders.current_status = 10) AND (purchase_orders.status = ANY ('{1,6,4}'::integer[])))
Index Cond: (purchase_orders.id = purchase_order_items.purchase_order_id)
Rows Removed by Filter: 0
0.82 ms	0.82 ms	↑ 1	1	1	273
13.	Index Scan using budgets_pkey on public.budgets as budgets (cost=0.42..8.44 rows=1 width=4) (actual=0.002..0.002 rows=1 loops=273)
Filter: (budgets.deleted_at IS NULL)
Index Cond: (budgets.id = 891016)
Rows Removed by Filter: 0
0.546 ms	0.546 ms	↑ 1	1	1	273
14.	Index Scan using index_purchase_order_comments_on_purchase_order_id on public.purchase_order_comments as purchase_order_comments (cost=0.43..29.83 rows=9 width=8) (actual=0.002..0.023 rows=70 loops=273)
Filter: (purchase_order_comments.deleted_at IS NULL)
Index Cond: (purchase_order_comments.purchase_order_id = purchase_orders.id)
Rows Removed by Filter: 0
6.279 ms	6.279 ms	↓ 7.78	70	9	273
15.	Index Only Scan using po_comment_upload_index on public.purchase_order_comments_uploads as purchase_order_comments_uploads (cost=0.42..2.08 rows=1 width=8) (actual=0.001..0.001 rows=0 loops=19034)
Index Cond: (purchase_order_comments_uploads.purchase_order_comment_id = purchase_order_comments.id)
19.034 ms	19.034 ms	↓ 0	0	1	19034
16.	Index Only Scan using po_upload_index on public.purchase_orders_uploads as purchase_orders_uploads (cost=0.43..4.12 rows=2 width=8) (actual=0.001..0.003 rows=41 loops=19034)
Index Cond: (purchase_orders_uploads.purchase_order_id = purchase_orders.id)
57.103 ms	57.103 ms	↓ 20.5	41	2	19034
17.	Index Scan using index_requests_on_purchase_order_id on public.requests as requests (cost=0.43..9.21 rows=2 width=8) (actual=0.001..0.001 rows=2 loops=787562)
Filter: (requests.deleted_at IS NULL)
Index Cond: (requests.purchase_order_id = purchase_orders.id)
Rows Removed by Filter: 1
787.562 ms	787.562 ms	↑ 1	2	2	787562
18.	Index Scan using index_custom_field_values_on_purchase_order_id on public.custom_field_values as custom_field_values (cost=0.44..9.09 rows=36 width=4) (actual=0.001..0.002 rows=14 loops=1299189)
Filter: (custom_field_values.deleted_at IS NULL)
Index Cond: (custom_field_values.purchase_order_id = purchase_orders.id)
Rows Removed by Filter: 0
2598.378 ms	2598.378 ms	↑ 2.58	14	36	1299189
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment