~ubuntu-branches/ubuntu/trusty/postgresql-8.4/trusty

« back to all changes in this revision

Viewing changes to src/backend/access/nbtree/nbtree.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-11 16:59:35 UTC
  • mfrom: (5.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090711165935-jfwin6gfrxf0gfsi
Tags: 8.4.0-2
* debian/libpq-dev.install: Ship catalog/genbki.h. (Closes: #536139)
* debian/rules: Drop --enable-cassert for final release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 * Portions Copyright (c) 1994, Regents of the University of California
13
13
 *
14
14
 * IDENTIFICATION
15
 
 *        $PostgreSQL: pgsql/src/backend/access/nbtree/nbtree.c,v 1.169 2009/05/05 19:36:32 tgl Exp $
 
15
 *        $PostgreSQL: pgsql/src/backend/access/nbtree/nbtree.c,v 1.171 2009/06/11 14:48:54 momjian Exp $
16
16
 *
17
17
 *-------------------------------------------------------------------------
18
18
 */
290
290
btgetbitmap(PG_FUNCTION_ARGS)
291
291
{
292
292
        IndexScanDesc scan = (IndexScanDesc) PG_GETARG_POINTER(0);
293
 
        TIDBitmap *tbm = (TIDBitmap *) PG_GETARG_POINTER(1);
 
293
        TIDBitmap  *tbm = (TIDBitmap *) PG_GETARG_POINTER(1);
294
294
        BTScanOpaque so = (BTScanOpaque) scan->opaque;
295
295
        int64           ntids = 0;
296
296
        ItemPointer heapTid;
579
579
        /*
580
580
         * During a non-FULL vacuum it's quite possible for us to be fooled by
581
581
         * concurrent page splits into double-counting some index tuples, so
582
 
         * disbelieve any total that exceeds the underlying heap's count. (We
583
 
         * can't check this during btbulkdelete.)
 
582
         * disbelieve any total that exceeds the underlying heap's count ... if we
 
583
         * know that accurately.  Otherwise this might just make matters worse.
584
584
         */
585
 
        if (!info->vacuum_full)
 
585
        if (!info->vacuum_full && !info->estimated_count)
586
586
        {
587
587
                if (stats->num_index_tuples > info->num_heap_tuples)
588
588
                        stats->num_index_tuples = info->num_heap_tuples;
618
618
         * Reset counts that will be incremented during the scan; needed in case
619
619
         * of multiple scans during a single VACUUM command
620
620
         */
 
621
        stats->estimated_count = false;
621
622
        stats->num_index_tuples = 0;
622
623
        stats->pages_deleted = 0;
623
624