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

Commit19da69a

Browse files
committed
check whether index column opclass is spoint2
1 parent65145e6 commit19da69a

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

‎init.c‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,13 @@ pick_suitable_index(Oid relation, AttrNumber column)
107107
HeapTuplehtup;
108108
SysScanDescscan;
109109
Relationpg_index;
110+
List*spoint2_opclass_name;
111+
Oidspoint2_opclass;
110112
ScanKeyDatakey[3];
111113

114+
spoint2_opclass_name=stringToQualifiedNameList("public.spoint2");
115+
spoint2_opclass=get_opclass_oid(GIST_AM_OID,spoint2_opclass_name, false);
116+
112117
ScanKeyInit(&key[0],
113118
Anum_pg_index_indrelid,
114119
BTEqualStrategyNumber,
@@ -146,9 +151,18 @@ pick_suitable_index(Oid relation, AttrNumber column)
146151
PointerGetDatum(cstring_to_text("main"))));
147152

148153
if (found_index==InvalidOid||cur_index_size<found_index_size)
149-
found_index=pg_ind->indexrelid;
150-
151-
break;/* no need to go further */
154+
{
155+
boolis_null;
156+
Datumindclass=heap_getattr(htup,Anum_pg_index_indclass,
157+
pg_index->rd_att,&is_null);
158+
oidvector*indclasses= (oidvector*)DatumGetPointer(indclass);
159+
160+
/* column must use 'spoint2' opclass */
161+
if (!is_null&&indclasses->values[i]==spoint2_opclass)
162+
found_index=pg_ind->indexrelid;
163+
}
164+
165+
break;/* no need to scan 'indkey' further */
152166
}
153167
}
154168
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp