Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT "states".*
- FROM "states"
- WHERE ("states"."customer_id" = $1 AND "states"."start" < $2)
- AND ("states"."end" IS NULL OR "states"."end" > $3)
- AND ("states"."obsolete" = $4)
- ORDER BY "states"."start" DESC
- Sort (cost=103089.00..103096.17 rows=2869 width=78)
- Sort Key: start DESC
- -> Bitmap Heap Scan on states (cost=1222.56..102924.23 rows=2869 width=78)
- Recheck Cond: (customer_id = '----'::bpchar)
- Filter: ((NOT obsolete) AND ((start)::double precision < '1557711009'::double precision) AND ((end IS NULL) OR ((end)::double precision > '1557666000'::double precision)))
- -> Bitmap Index Scan on states_index (cost=0.00..1221.85 rows=26820 width=0)
- Index Cond: (customer_id = '----'::bpchar)
- Sort Key: start DESC
- Sort Method: quicksort Memory: 25kB
- -> Bitmap Heap Scan on states (cost=111.12..9338.04 rows=1 width=78) (actual time=141.674..141.674 rows=0 loops=1)
- 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)))
- Filter: ((NOT obsolete) AND ((title)::text = '---'::text))
- Rows Removed by Filter: 112
- Heap Blocks: exact=101
- -> BitmapOr (cost=111.12..111.12 rows=2333 width=0) (actual time=4.198..4.198 rows=0 loops=1)
- -> 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)
- Index Cond: ((customer_id = '----'::bpchar) AND (end IS NULL) AND (start < '1557349200'::numeric))
- -> 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)
- Index Cond: ((customer_id = '---'::bpchar) AND (end > '1557262800'::numeric) AND (start < '1557349200'::numeric))
- Database Name | Temporary files | Size of temporary files | Block Hits | Block Reads
- ------------------+-----------------+-------------------------+---------------+-------------
- customers | 1922 | 18784440622 | 69553504584 | 2401546773
- >>> 69553504584.0 / (69553504584.0 + 2401546773.0)
- 0.9666243477322406
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement