~ubuntu-branches/ubuntu/natty/postgresql-8.4/natty-security

« back to all changes in this revision

Viewing changes to src/backend/access/hash/hashsort.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:
8
8
 * thrashing.  We use tuplesort.c to sort the given index tuples into order.
9
9
 *
10
10
 * Note: if the number of rows in the table has been underestimated,
11
 
 * bucket splits may occur during the index build.  In that case we'd
 
11
 * bucket splits may occur during the index build.      In that case we'd
12
12
 * be inserting into two or more buckets for each possible masked-off
13
13
 * hash code value.  That's no big problem though, since we'll still have
14
14
 * plenty of locality of access.
18
18
 * Portions Copyright (c) 1994, Regents of the University of California
19
19
 *
20
20
 * IDENTIFICATION
21
 
 *        $PostgreSQL: pgsql/src/backend/access/hash/hashsort.c,v 1.2 2009/01/01 17:23:35 momjian Exp $
 
21
 *        $PostgreSQL: pgsql/src/backend/access/hash/hashsort.c,v 1.3 2009/06/11 14:48:53 momjian Exp $
22
22
 *
23
23
 *-------------------------------------------------------------------------
24
24
 */
52
52
        hspool->index = index;
53
53
 
54
54
        /*
55
 
         * Determine the bitmask for hash code values.  Since there are currently
 
55
         * Determine the bitmask for hash code values.  Since there are currently
56
56
         * num_buckets buckets in the index, the appropriate mask can be computed
57
57
         * as follows.
58
58
         *
59
 
         * Note: at present, the passed-in num_buckets is always a power of 2,
60
 
         * so we could just compute num_buckets - 1.  We prefer not to assume
61
 
         * that here, though.
 
59
         * Note: at present, the passed-in num_buckets is always a power of 2, so
 
60
         * we could just compute num_buckets - 1.  We prefer not to assume that
 
61
         * here, though.
62
62
         */
63
63
        hash_mask = (((uint32) 1) << _hash_log2(num_buckets)) - 1;
64
64