Guest User

Untitled

a guest
Jun 24th, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. portal=# explain analyze SELECT t1.detectorid, description, t1.total as count, t3.count,
  2. CAST(t1.total AS NUMERIC) / CAST(t3.count AS NUMERIC) * 100.0 AS percentage
  3. FROM selena.test_agg t1,
  4. selena.detectorid_count t3
  5. WHERE t1.detectorid = t3.detectorid
  6. ORDER BY t1.detectorid, description, t3.count;
  7. QUERY PLAN
  8. -----------------------------------------------------------------------------------------------------------------------------------
  9. Sort (cost=145.30..148.77 rows=1386 width=19) (actual time=6.407..7.116 rows=1386 loops=1)
  10. Sort Key: t1.detectorid, t1.description, t3.count
  11. Sort Method: quicksort Memory: 157kB
  12. -> Hash Join (cost=17.20..72.97 rows=1386 width=19) (actual time=0.972..5.238 rows=1386 loops=1)
  13. Hash Cond: (t1.detectorid = t3.detectorid)
  14. -> Seq Scan on test_agg t1 (cost=0.00..22.86 rows=1386 width=15) (actual time=0.028..0.909 rows=1386 loops=1)
  15. -> Hash (cost=9.31..9.31 rows=631 width=8) (actual time=0.920..0.920 rows=631 loops=1)
  16. -> Seq Scan on detectorid_count t3 (cost=0.00..9.31 rows=631 width=8) (actual time=0.028..0.469 rows=631 loops=1)
  17. Total runtime: 7.880 ms
  18. (9 rows)
Add Comment
Please, Sign In to add comment