Advertisement
Guest User

explain

a guest
Oct 2nd, 2018
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.23 KB | None | 0 0
  1. Unique (cost=530228.08..567467.26 rows=1238765 width=8) (actual time=2529.774..3711.967 rows=6316 loops=1)
  2. -> GroupAggregate (cost=530228.08..564370.35 rows=1238765 width=8) (actual time=2529.774..3692.622 rows=317537 loops=1)
  3. Group Key: doers.id, jp.id
  4. Filter: ((count(DISTINCT jr.id) < jp.realizations_per_place) AND (count(DISTINCT jrpd.id) < jp.realizations_per_place_per_doer))
  5. Rows Removed by Filter: 81814
  6. -> Merge Left Join (cost=530228.08..539595.05 rows=1238765 width=24) (actual time=2529.747..2834.627 rows=546144 loops=1)
  7. Merge Cond: ((doers.id = jrpd.doer_id) AND (jp.id = jrpd.job_place_id))
  8. -> Sort (cost=529287.20..532384.11 rows=1238765 width=20) (actual time=2524.038..2715.611 rows=546144 loops=1)
  9. Sort Key: doers.id, jp.id
  10. Sort Method: external merge Disk: 15384kB
  11. -> Hash Join (cost=552.72..353108.26 rows=1238765 width=20) (actual time=13.393..2198.656 rows=546144 loops=1)
  12. Hash Cond: (dl.doer_id = doers.id)
  13. -> Nested Loop (cost=23.72..335546.24 rows=1238765 width=20) (actual time=1.346..2006.015 rows=546144 loops=1)
  14. -> Merge Left Join (cost=0.57..1396.01 rows=10034 width=40) (actual time=0.039..40.320 rows=13631 loops=1)
  15. Merge Cond: (jp.id = jr.job_place_id)
  16. -> 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)
  17. Filter: (job_id = 1)
  18. -> 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)
  19. Filter: (status = ANY ('{0,1,2,3,7}'::integer[]))
  20. -> 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)
  21. 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))
  22. Heap Blocks: exact=395301
  23. -> BitmapAnd (cost=23.15..23.15 rows=123 width=0) (actual time=0.117..0.117 rows=0 loops=13631)
  24. -> 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)
  25. Index Cond: ((((jp.lng - 0.5001626620527362))::double precision < lng) AND (((jp.lng + 0.5001626620527362))::double precision > lng))
  26. -> 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)
  27. Index Cond: ((((jp.lat - 0.3147625620715557))::double precision < lat) AND (((jp.lat + 0.3147625620715557))::double precision > lat))
  28. -> Hash (cost=404.00..404.00 rows=10000 width=4) (actual time=11.811..11.811 rows=10000 loops=1)
  29. Buckets: 16384 Batches: 1 Memory Usage: 480kB
  30. -> Seq Scan on doers (cost=0.00..404.00 rows=10000 width=4) (actual time=0.012..9.410 rows=10000 loops=1)
  31. Filter: (id IS NOT NULL)
  32. -> Sort (cost=940.89..965.89 rows=10000 width=12) (actual time=5.705..7.953 rows=10045 loops=1)
  33. Sort Key: jrpd.doer_id, jrpd.job_place_id
  34. Sort Method: quicksort Memory: 853kB
  35. -> 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)
  36. Filter: (status = ANY ('{0,1,2,3,7}'::integer[]))
  37. Planning time: 3.200 ms
  38. Execution time: 3718.578 ms
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement