On Fri, May 27, 2011 at 8:40 PM, Greg Stark <gsst...@mit.edu> wrote: > > Separately it's a bit strange that we actually have to visit the > pages. We have all the information we need in the VM to determine > whether there's a run of 32 vacuum-clean pages. Why can't we look at > the next 32 pages and if they're all vacuum-clean then skip looking at > the heap at all for them. What we do now is do the regular vacuum > algorithm and only after we've processed 32 pages in a row realize > that it was a waste of effort. >
May be we want to have visibility map APIs to test if a chunk of pages are all visible or not. We can then use that API to test every N blocks (where N is the number where continuous sequential scans would still be better than sequential scans with gaps) and either read all of them sequentially or just skip all of them. Thanks, Pavan -- Pavan Deolasee EnterpriseDB http://www.enterprisedb.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers