All pastes #268478 Raw Edit

Stuff

public text v1 · immutable
·published 2006-12-05 19:39 UTC
rendered paste body
postgres=# EXPLAIN ANALYZE SELECT COUNT(*) FROM stats WHERE (inc_tg_name='QWEST' OR out_tg_name='QWEST') AND (conn_date_month=9 OR conn_date_month=10) AND conn_date_year=2006;
                                                                           QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=2879257.02..2879257.03 rows=1 width=0) (actual time=4117809.262..4117809.264 rows=1 loops=1)
   ->  Bitmap Heap Scan on stats  (cost=49780.58..2871268.90 rows=3195245 width=0) (actual time=1907951.296..4112824.587 rows=3325010 loops=1)
         Recheck Cond: ((inc_tg_name = 'QWEST'::text) OR (out_tg_name = 'QWEST'::text))
         Filter: (((conn_date_month = 9) OR (conn_date_month = 10)) AND (conn_date_year = 2006))
         ->  BitmapOr  (cost=49780.58..49780.58 rows=6621881 width=0) (actual time=697139.872..697139.872 rows=0 loops=1)
               ->  Bitmap Index Scan on inc_tg_name_index  (cost=0.00..21438.41 rows=2918117 width=0) (actual time=309265.221..309265.221 rows=2721993 loops=1)
                     Index Cond: (inc_tg_name = 'QWEST'::text)
               ->  Bitmap Index Scan on out_tg_name_index  (cost=0.00..28342.17 rows=3703764 width=0) (actual time=387874.644..387874.644 rows=4063085 loops=1)
                     Index Cond: (out_tg_name = 'QWEST'::text)
 Total runtime: 4117809.935 ms
(10 rows)