explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VBdb

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=371,791.88..371,792.27 rows=158 width=57) (actual rows= loops=)

  • Sort Key: (sum((sum((ts_rank(search_contents_1.tsv_text, to_tsquery('simple'::regconfig, unaccent('Luis'::text))) * (search_contents_1.weight)::double precision))))) DESC
2. 0.000 0.000 ↓ 0.0

Finalize GroupAggregate (cost=366,473.65..371,786.11 rows=158 width=57) (actual rows= loops=)

  • Group Key: search_contents_1.item_type, search_contents_1.item_id
3. 0.000 0.000 ↓ 0.0

Gather Merge (cost=366,473.65..371,781.37 rows=316 width=57) (actual rows= loops=)

  • Workers Planned: 2
4. 0.000 0.000 ↓ 0.0

Partial GroupAggregate (cost=365,473.62..370,744.87 rows=158 width=57) (actual rows= loops=)

  • Group Key: search_contents_1.item_type, search_contents_1.item_id
5. 0.000 0.000 ↓ 0.0

Merge Join (cost=365,473.62..368,650.44 rows=209,285 width=49) (actual rows= loops=)

  • Merge Cond: ((search_contents_1.item_id)::text = (search_contents.item_id)::text)
6. 0.000 0.000 ↓ 0.0

Sort (cost=61,473.87..61,492.70 rows=7,532 width=57) (actual rows= loops=)

  • Sort Key: search_contents_1.item_id
7. 0.000 0.000 ↓ 0.0

Hash Join (cost=44,543.93..60,988.86 rows=7,532 width=57) (actual rows= loops=)

  • Hash Cond: ((work_assignments.id)::text = (search_contents_1.item_id)::text)
8. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on work_assignments (cost=0.00..16,310.02 rows=9,534 width=8) (actual rows= loops=)

  • Filter: ((starts_on >= '2019-06-04'::date) AND (starts_on <= '2019-09-04'::date))
9. 0.000 0.000 ↓ 0.0

Hash (cost=44,541.95..44,541.95 rows=158 width=49) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=44,266.57..44,540.37 rows=158 width=49) (actual rows= loops=)

  • Group Key: search_contents_1.item_type, search_contents_1.item_id
11. 0.000 0.000 ↓ 0.0

Merge Join (cost=44,266.57..44,496.53 rows=158 width=80) (actual rows= loops=)

  • Merge Cond: ((search_contents_1.item_id)::text = ((work_assignments_1.id)::text))
12. 0.000 0.000 ↓ 0.0

Sort (cost=25,183.92..25,183.93 rows=1 width=80) (actual rows= loops=)

  • Sort Key: search_contents_1.item_id
13. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,798.12..25,183.91 rows=1 width=80) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Seq Scan on accounts accounts_1 (cost=0.00..63.00 rows=8 width=8) (actual rows= loops=)

  • Filter: ((country_code)::text = 'ES'::text)
15. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on search_contents search_contents_1 (cost=2,798.12..3,140.10 rows=1 width=88) (actual rows= loops=)

  • Recheck Cond: ((account_id = accounts_1.id) AND (tsv_text @@ to_tsquery('simple'::regconfig, unaccent('Luis'::text))))
  • Filter: (((item_type)::text = 'WorkAssignment'::text) AND ((subitem)::text = 'worker'::text))
16. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=2,798.12..2,798.12 rows=81 width=0) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on index_search_contents_on_account_id (cost=0.00..600.50 rows=32,475 width=0) (actual rows= loops=)

  • Index Cond: (account_id = accounts_1.id)
18. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on full_text_index (cost=0.00..2,197.30 rows=33,206 width=0) (actual rows= loops=)

  • Index Cond: (tsv_text @@ to_tsquery('simple'::regconfig, unaccent('Luis'::text)))
19. 0.000 0.000 ↓ 0.0

Sort (cost=19,082.64..19,139.84 rows=22,881 width=8) (actual rows= loops=)

  • Sort Key: ((work_assignments_1.id)::text)
20. 0.000 0.000 ↓ 0.0

Seq Scan on work_assignments work_assignments_1 (cost=0.00..17,425.85 rows=22,881 width=8) (actual rows= loops=)

  • Filter: ((starts_on >= '2019-06-04'::date) AND (starts_on <= '2019-09-04'::date))
21. 0.000 0.000 ↓ 0.0

Sort (cost=303,999.75..304,013.64 rows=5,557 width=41) (actual rows= loops=)

  • Sort Key: search_contents.item_id
22. 0.000 0.000 ↓ 0.0

Nested Loop (cost=27,706.82..303,654.10 rows=5,557 width=41) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Seq Scan on accounts (cost=0.00..63.00 rows=8 width=8) (actual rows= loops=)

  • Filter: ((country_code)::text = 'ES'::text)
24. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on search_contents (cost=27,706.82..37,920.36 rows=2,853 width=49) (actual rows= loops=)

  • Recheck Cond: ((account_id = accounts.id) AND ((item_type)::text = 'WorkAssignment'::text))
25. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=27,706.82..27,706.82 rows=2,853 width=0) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on index_search_contents_on_account_id (cost=0.00..600.50 rows=32,475 width=0) (actual rows= loops=)

  • Index Cond: (account_id = accounts.id)
27. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on index_search_contents_on_item_type (cost=0.00..26,813.59 rows=1,167,071 width=0) (actual rows= loops=)

  • Index Cond: ((item_type)::text = 'WorkAssignment'::text)