Wenn Ihre Tabelle häufig aktualisiert oder neue Zeilen eingefügt werden, empfehlen wir, den vorhandenen ScaNN-Index regelmäßig neu zu indexieren, um die Recall-Genauigkeit zu verbessern. Sie können Indexmesswerte beobachten, um Änderungen an Vektorverteilungen oder Vektormutationen seit der Erstellung des Index zu sehen, und den Index dann entsprechend neu indexieren.
Sie können Ihren Index manuell neu erstellen, wenn Sie ihn mit den Konfigurationen neu erstellen möchten, die Sie bei der Erstellung angegeben haben.
Führen Sie den folgenden Befehl aus, um Ihren Index manuell neu zu erstellen:
REINDEXINDEXCONCURRENTLYINDEX_NAME;
Ersetzen Sie INDEX_NAME durch den Namen des Index, den Sie neu erstellen möchten, z. B. my-scann-index. Die Indexnamen sind in Ihrer Datenbank freigegeben. Achten Sie darauf, dass jeder Indexname für jede Tabelle in Ihrer Datenbank eindeutig ist.
Weitere Informationen zum Reindexieren in PostgreSQL finden Sie unter REINDEX.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-05 (UTC)."],[[["\u003cp\u003eVector indexes may require maintenance to adapt to data changes and maintain search accuracy.\u003c/p\u003e\n"],["\u003cp\u003eReindexing is recommended for tables with frequent updates or insertions to improve the recall accuracy of the index.\u003c/p\u003e\n"],["\u003cp\u003eYou can monitor index metrics to identify changes in vector distributions or mutations that might necessitate reindexing.\u003c/p\u003e\n"],["\u003cp\u003eYou can manually rebuild a vector index using the \u003ccode\u003eREINDEX INDEX CONCURRENTLY\u003c/code\u003e command, providing the index name.\u003c/p\u003e\n"],["\u003cp\u003eIndex names must be unique per table within the database.\u003c/p\u003e\n"]]],[],null,["Select a documentation version: Current (16.8.0)keyboard_arrow_down\n\n- [Current (16.8.0)](/alloydb/omni/current/docs/ai/maintain-vector-indexes)\n- [16.8.0](/alloydb/omni/16.8.0/docs/ai/maintain-vector-indexes)\n- [16.3.0](/alloydb/omni/16.3.0/docs/ai/maintain-vector-indexes)\n- [15.12.0](/alloydb/omni/15.12.0/docs/ai/maintain-vector-indexes)\n- [15.7.1](/alloydb/omni/15.7.1/docs/ai/maintain-vector-indexes)\n- [15.7.0](/alloydb/omni/15.7.0/docs/ai/maintain-vector-indexes)\n\n\u003cbr /\u003e\n\nThis document explains different options that you can use to maintain vector indexes. You might want to maintain indexes to ensure that your indexes adapt to the changes in data that might impact accuracy of your search results. As your dataset grows, use the strategies in the following sections to avoid degradation in query performance.\n\n\u003cbr /\u003e\n\nView vector index metrics\n\nIf your table is prone to frequent updates or insertions, then we recommend\nperiodically [reindexing the existing ScaNN index](#manually-rebuild-index)\nin order to improve the recall accuracy for your index. You can monitor\nindex metrics to view changes in vector distributions or vector mutations since\nthe index was built, and then reindex accordingly.\n\nFor more information about metrics, see [View Vector index metrics](/alloydb/omni/current/docs/reference/vector-index-metrics).\n\nManually rebuild your index\n\nYou can manually rebuild your index if you want to\nrebuild it with the configurations you specified when it was created.\n\nTo manually rebuild your index, run the following command: \n\n REINDEX INDEX CONCURRENTLY \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eINDEX_NAME\u003c/span\u003e\u003c/var\u003e;\n\nReplace \u003cvar translate=\"no\"\u003eINDEX_NAME\u003c/var\u003e with the name of the index you want to\nrebuild---for example, `my-scann-index`. The index names are shared\nacross your database. Ensure that each index name is unique to each\ntable in your database.\n\nFor more information about reindexing in PostgreSQL, see\n[REINDEX](https://www.postgresql.org/docs/15/sql-reindex.html).\n\nWhat's next\n\n- [Vector index metrics](/alloydb/omni/current/docs/reference/vector-index-metrics)\n- [Optimize vector query performance for ScaNN](/alloydb/omni/current/docs/ai/scann-vector-query-perf-overview)"]]