Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc8076f0

Browse files
committed
Restructure index AM interface for index building and index tuple deletion,
per previous discussion on pghackers. Most of the duplicate code indifferent AMs' ambuild routines has been moved out to a common routinein index.c; this means that all index types now do the right things aboutinserting recently-dead tuples, etc. (I also removed support for EXTENDINDEX in the ambuild routines, since that's about to go away anyway, andit cluttered the code a lot.) The retail indextuple deletion routines havebeen replaced by a "bulk delete" routine in which the indexscan is insidethe access method. I haven't pushed this change as far as it should go yet,but it should allow considerable simplification of the internal bookkeepingfor deletions. Also, add flag columns to pg_am to eliminate varioushardcoded tests on AM OIDs, and remove unused pg_am columns.Fix rtree and gist index types to not attempt to store NULLs; before this,gist usually crashed, while rtree managed not to crash but computed wackobounding boxes for NULL entries (which might have had something to do withthe performance problems we've heard about occasionally).Add AtEOXact routines to hash, rtree, and gist, all of which have staticstate that needs to be reset after an error. We discovered this need longago for btree, but missed the other guys.Oh, one more thing: concurrent VACUUM is now the default.
1 parent997439f commitc8076f0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1481
-1644
lines changed

‎doc/src/sgml/catalogs.sgml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22
Documentation of the system catalogs, directed toward PostgreSQL developers
3-
$Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.18 2001/06/12 05:55:48 tgl Exp $
3+
$Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.19 2001/07/15 22:48:15 tgl Exp $
44
-->
55

66
<chapter id="catalogs">
@@ -1045,7 +1045,8 @@
10451045
<entry>indpred</entry>
10461046
<entry><type>text</type></entry>
10471047
<entry></entry>
1048-
<entry>Query plan for partial index predicate (not functional)</entry>
1048+
<entry>Expression tree (in the form of a nodeToString representation)
1049+
for partial index predicate</entry>
10491050
</row>
10501051
</tbody>
10511052
</tgroup>

‎src/backend/access/common/indexvalid.c

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.26 2001/01/24 19:42:47 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.27 2001/07/15 22:48:15 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -24,12 +24,9 @@
2424
*/
2525
intNIndexTupleProcessed;
2626

27+
2728
/* ----------------
28-
*index_keytest
29-
*
30-
* old comments
31-
*May eventually combine with other tests (like timeranges)?
32-
*Should have Buffer buffer; as an argument and pass it to amgetattr.
29+
*index_keytest - does this index tuple satisfy the scan key(s)?
3330
* ----------------
3431
*/
3532
bool
@@ -38,16 +35,16 @@ index_keytest(IndexTuple tuple,
3835
intscanKeySize,
3936
ScanKeykey)
4037
{
41-
boolisNull;
42-
Datumdatum;
43-
Datumtest;
44-
4538
IncrIndexProcessed();
4639

4740
while (scanKeySize>0)
4841
{
42+
Datumdatum;
43+
boolisNull;
44+
Datumtest;
45+
4946
datum=index_getattr(tuple,
50-
key[0].sk_attno,
47+
key->sk_attno,
5148
tupdesc,
5249
&isNull);
5350

@@ -57,25 +54,19 @@ index_keytest(IndexTuple tuple,
5754
return false;
5855
}
5956

60-
if (key[0].sk_flags&SK_ISNULL)
57+
if (key->sk_flags&SK_ISNULL)
6158
return false;
6259

63-
if (key[0].sk_flags&SK_COMMUTE)
64-
{
65-
test=FunctionCall2(&key[0].sk_func,
66-
key[0].sk_argument,datum);
67-
}
60+
if (key->sk_flags&SK_COMMUTE)
61+
test=FunctionCall2(&key->sk_func,key->sk_argument,datum);
6862
else
69-
{
70-
test=FunctionCall2(&key[0].sk_func,
71-
datum,key[0].sk_argument);
72-
}
63+
test=FunctionCall2(&key->sk_func,datum,key->sk_argument);
7364

74-
if (DatumGetBool(test)== !!(key[0].sk_flags&SK_NEGATE))
65+
if (DatumGetBool(test)== !!(key->sk_flags&SK_NEGATE))
7566
return false;
7667

77-
scanKeySize-=1;
7868
key++;
69+
scanKeySize--;
7970
}
8071

8172
return true;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp