Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Unique (cost=530228.08..567467.26 rows=1238765 width=8) (actual time=2529.774..3711.967 rows=6316 loops=1)
- -> GroupAggregate (cost=530228.08..564370.35 rows=1238765 width=8) (actual time=2529.774..3692.622 rows=317537 loops=1)
- Group Key: doers.id, jp.id
- Filter: ((count(DISTINCT jr.id) < jp.realizations_per_place) AND (count(DISTINCT jrpd.id) < jp.realizations_per_place_per_doer))
- Rows Removed by Filter: 81814
- -> Merge Left Join (cost=530228.08..539595.05 rows=1238765 width=24) (actual time=2529.747..2834.627 rows=546144 loops=1)
- Merge Cond: ((doers.id = jrpd.doer_id) AND (jp.id = jrpd.job_place_id))
- -> Sort (cost=529287.20..532384.11 rows=1238765 width=20) (actual time=2524.038..2715.611 rows=546144 loops=1)
- Sort Key: doers.id, jp.id
- Sort Method: external merge Disk: 15384kB
- -> Hash Join (cost=552.72..353108.26 rows=1238765 width=20) (actual time=13.393..2198.656 rows=546144 loops=1)
- Hash Cond: (dl.doer_id = doers.id)
- -> Nested Loop (cost=23.72..335546.24 rows=1238765 width=20) (actual time=1.346..2006.015 rows=546144 loops=1)
- -> Merge Left Join (cost=0.57..1396.01 rows=10034 width=40) (actual time=0.039..40.320 rows=13631 loops=1)
- Merge Cond: (jp.id = jr.job_place_id)
- -> Index Scan using job_places_pkey on job_places jp (cost=0.29..471.88 rows=10034 width=36) (actual time=0.027..16.317 rows=10000 loops=1)
- Filter: (job_id = 1)
- -> Index Scan using index_job_realizations_on_job_place_id on job_realizations jr (cost=0.29..788.77 rows=10000 width=8) (actual time=0.009..16.542 rows=10000 loops=1)
- Filter: (status = ANY ('{0,1,2,3,7}'::integer[]))
- -> Bitmap Heap Scan on doer_locations dl (cost=23.15..32.07 rows=123 width=20) (actual time=0.120..0.136 rows=40 loops=13631)
- Recheck Cond: ((((jp.lng - 0.5001626620527362))::double precision < lng) AND (((jp.lng + 0.5001626620527362))::double precision > lng) AND (((jp.lat - 0.3147625620715557))::double precision < lat) AND (((jp.lat + 0.3147625620715557))::double precision > lat))
- Heap Blocks: exact=395301
- -> BitmapAnd (cost=23.15..23.15 rows=123 width=0) (actual time=0.117..0.117 rows=0 loops=13631)
- -> Bitmap Index Scan on index_doer_locations_on_lng (cost=0.00..11.42 rows=1111 width=0) (actual time=0.064..0.064 rows=797 loops=13631)
- Index Cond: ((((jp.lng - 0.5001626620527362))::double precision < lng) AND (((jp.lng + 0.5001626620527362))::double precision > lng))
- -> Bitmap Index Scan on index_doer_locations_on_lat (cost=0.00..11.42 rows=1111 width=0) (actual time=0.042..0.042 rows=504 loops=13631)
- Index Cond: ((((jp.lat - 0.3147625620715557))::double precision < lat) AND (((jp.lat + 0.3147625620715557))::double precision > lat))
- -> Hash (cost=404.00..404.00 rows=10000 width=4) (actual time=11.811..11.811 rows=10000 loops=1)
- Buckets: 16384 Batches: 1 Memory Usage: 480kB
- -> Seq Scan on doers (cost=0.00..404.00 rows=10000 width=4) (actual time=0.012..9.410 rows=10000 loops=1)
- Filter: (id IS NOT NULL)
- -> Sort (cost=940.89..965.89 rows=10000 width=12) (actual time=5.705..7.953 rows=10045 loops=1)
- Sort Key: jrpd.doer_id, jrpd.job_place_id
- Sort Method: quicksort Memory: 853kB
- -> Seq Scan on job_realizations jrpd (cost=0.00..276.50 rows=10000 width=12) (actual time=0.032..2.202 rows=10000 loops=1)
- Filter: (status = ANY ('{0,1,2,3,7}'::integer[]))
- Planning time: 3.200 ms
- Execution time: 3718.578 ms
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement