I should have included query plan for the query which caused the "could not
find free pages" error.
This is a contrived query which I made up to try to exercise/stress bitmap
scans based on Thomas's working hypothesis for this error/bug. This seems to
be easier to hit than the other error ("could not attach to segment") - a loop
around this query has run into "free pages" several times today.
explain (analyze,costs off,timing off) SELECT * FROM eric_enodeb_metrics WHERE
start_time>='2017-10-01' AND (site_id<1900 OR site_id>2700)
Gather (actual rows=82257 loops=1)
Workers Planned: 3
Workers Launched: 3
-> Parallel Append (actual rows=20564 loops=4)
-> Parallel Bitmap Heap Scan on eric_enodeb_201901 (actual rows=6366
loops=4)
Recheck Cond: ((site_id < 1900) OR (site_id > 2700))
Filter: (start_time >= '2017-10-01 00:00:00-04'::timestamp with
time zone)
Heap Blocks: exact=2549
-> BitmapOr (actual rows=0 loops=1)
-> Bitmap Index Scan on eric_enodeb_201901_site_idx
(actual rows=0 loops=1)
Index Cond: (site_id < 1900)
-> Bitmap Index Scan on eric_enodeb_201901_site_idx
(actual rows=25463 loops=1)
Index Cond: (site_id > 2700)
-> Parallel Bitmap Heap Scan on eric_enodeb_201810 (actual rows=15402
loops=1)
Recheck Cond: ((site_id < 1900) OR (site_id > 2700))
Filter: (start_time >= '2017-10-01 00:00:00-04'::timestamp with
time zone)
-> BitmapOr (actual rows=0 loops=1)
-> Bitmap Index Scan on eric_enodeb_201810_site_idx
(actual rows=0 loops=1)
Index Cond: (site_id < 1900)
-> Bitmap Index Scan on eric_enodeb_201810_site_idx
(actual rows=15402 loops=1)
Index Cond: (site_id > 2700)
-> Parallel Bitmap Heap Scan on eric_enodeb_201812 (actual rows=14866
loops=1)
Recheck Cond: ((site_id < 1900) OR (site_id > 2700))
Filter: (start_time >= '2017-10-01 00:00:00-04'::timestamp with
time zone)
-> BitmapOr (actual rows=0 loops=1)
-> Bitmap Index Scan on eric_enodeb_201812_site_idx
(actual rows=0 loops=1)
Index Cond: (site_id < 1900)
-> Bitmap Index Scan on eric_enodeb_201812_site_idx
(actual rows=14866 loops=1)
Index Cond: (site_id > 2700)
-> Parallel Bitmap Heap Scan on eric_enodeb_201811 (actual rows=7204
loops=2)
Recheck Cond: ((site_id < 1900) OR (site_id > 2700))
Filter: (start_time >= '2017-10-01 00:00:00-04'::timestamp with
time zone)
Heap Blocks: exact=7372
-> BitmapOr (actual rows=0 loops=1)
-> Bitmap Index Scan on eric_enodeb_201811_site_idx
(actual rows=0 loops=1)
Index Cond: (site_id < 1900)
-> Bitmap Index Scan on eric_enodeb_201811_site_idx
(actual rows=14408 loops=1)
Index Cond: (site_id > 2700)
-> Parallel Bitmap Heap Scan on eric_enodeb_201902 (actual rows=5128
loops=1)
Recheck Cond: ((site_id < 1900) OR (site_id > 2700))
Filter: (start_time >= '2017-10-01 00:00:00-04'::timestamp with
time zone)
Heap Blocks: exact=3374
-> BitmapOr (actual rows=0 loops=1)
-> Bitmap Index Scan on eric_enodeb_201902_site_idx
(actual rows=0 loops=1)
Index Cond: (site_id < 1900)
-> Bitmap Index Scan on eric_enodeb_201902_site_idx
(actual rows=5128 loops=1)
Index Cond: (site_id > 2700)
[...]
Justin