SHARE
TWEET

Untitled

a guest Jun 20th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT "states".*
  2. FROM "states"
  3. WHERE ("states"."customer_id" = $1 AND "states"."start" < $2)
  4.        AND ("states"."end" IS NULL OR "states"."end" > $3)
  5.        AND ("states"."obsolete" = $4)
  6. ORDER BY "states"."start" DESC
  7.      
  8. Sort  (cost=103089.00..103096.17 rows=2869 width=78)
  9.   Sort Key: start DESC
  10.   ->  Bitmap Heap Scan on states  (cost=1222.56..102924.23 rows=2869 width=78)
  11.         Recheck Cond: (customer_id = '----'::bpchar)
  12.         Filter: ((NOT obsolete) AND ((start)::double precision < '1557711009'::double precision) AND ((end IS NULL) OR ((end)::double precision > '1557666000'::double precision)))
  13.         ->  Bitmap Index Scan on states_index  (cost=0.00..1221.85 rows=26820 width=0)
  14.               Index Cond: (customer_id = '----'::bpchar)
  15.      
  16. Sort Key: start DESC
  17. Sort Method: quicksort  Memory: 25kB
  18. ->  Bitmap Heap Scan on states  (cost=111.12..9338.04 rows=1 width=78) (actual time=141.674..141.674 rows=0 loops=1)
  19.       Recheck Cond: (((customer_id = '-----'::bpchar) AND (end IS NULL) AND (start < '1557349200'::numeric)) OR ((customer_id = '----'::bpchar) AND (end > '1557249200'::numeric) AND (start < '1557349200'::numeric)))
  20.       Filter: ((NOT obsolete) AND ((title)::text = '---'::text))
  21.       Rows Removed by Filter: 112
  22.       Heap Blocks: exact=101
  23.       ->  BitmapOr  (cost=111.12..111.12 rows=2333 width=0) (actual time=4.198..4.198 rows=0 loops=1)
  24.             ->  Bitmap Index Scan on states_index  (cost=0.00..4.57 rows=1 width=0) (actual time=0.086..0.086 rows=0 loops=1)
  25.                   Index Cond: ((customer_id = '----'::bpchar) AND (end IS NULL) AND (start < '1557349200'::numeric))
  26.             ->  Bitmap Index Scan on state_index  (cost=0.00..106.55 rows=2332 width=0) (actual time=4.109..4.109 rows=112 loops=1)
  27.                   Index Cond: ((customer_id = '---'::bpchar) AND (end > '1557262800'::numeric) AND (start < '1557349200'::numeric))
  28.      
  29. Database Name   | Temporary files | Size of temporary files |  Block Hits   | Block Reads
  30. ------------------+-----------------+-------------------------+---------------+-------------
  31.  customers        |            1922 |             18784440622 |   69553504584 |  2401546773
  32.      
  33. >>> 69553504584.0 / (69553504584.0 + 2401546773.0)
  34. 0.9666243477322406
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top