Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QUERY PLAN
- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Unique (cost=39795.56..39796.87 rows=261 width=4) (actual time=563.203..563.298 rows=167 loops=1)
- -> Sort (cost=39795.56..39796.22 rows=261 width=4) (actual time=563.200..563.235 rows=174 loops=1)
- Sort Key: c.id DESC
- Sort Method: quicksort Memory: 33kB
- -> Nested Loop (cost=30795.57..39785.09 rows=261 width=4) (actual time=425.001..562.961 rows=174 loops=1)
- -> Nested Loop (cost=30795.14..38660.20 rows=631 width=8) (actual time=424.969..560.135 rows=322 loops=1)
- -> Hash Join (cost=30794.71..37656.70 rows=1992 width=12) (actual time=424.903..556.980 rows=349 loops=1)
- Hash Cond: (cu.company_id = companies.id)
- -> Seq Scan on company_users cu (cost=0.00..6210.90 rows=168311 width=8) (actual time=0.017..93.786 rows=168340 loops=1)
- Filter: (role = 'owner'::company_user_roles)
- Rows Removed by Filter: 114718
- -> Hash (cost=30548.26..30548.26 rows=19716 width=4) (actual time=424.637..424.637 rows=16640 loops=1)
- Buckets: 32768 Batches: 1 Memory Usage: 841kB
- -> Bitmap Heap Scan on companies (cost=264.93..30548.26 rows=19716 width=4) (actual time=62.851..409.732 rows=16640 loops=1)
- Recheck Cond: (main_region_id = ANY ('{151,104,391,168,424}'::integer[]))
- Heap Blocks: exact=6663
- -> Bitmap Index Scan on index_companies_on_main_region_id_new (cost=0.00..260.00 rows=19716 width=0) (actual time=60.440..60.440 rows=16640 loops=1)
- Index Cond: (main_region_id = ANY ('{151,104,391,168,424}'::integer[]))
- -> Index Only Scan using index_for_deliveries_on_users_email on users u (cost=0.43..0.49 rows=1 width=4) (actual time=0.007..0.008 rows=1 loops=349)
- Index Cond: (id = cu.user_id)
- Heap Fetches: 263
- -> Index Scan using ipart_companies_id_state_not_deleted on companies c (cost=0.43..1.77 rows=1 width=4) (actual time=0.008..0.008 rows=1 loops=322)
- Index Cond: (id = cu.company_id)
- Filter: ((NOT COALESCE(tmp, false)) AND ((state)::text <> ALL ('{deleted,rejected}'::text[])))
- Rows Removed by Filter: 0
- Planning time: 31.532 ms
- Execution time: 563.640 ms
- (27 rows)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement