📣新登場!TiDB Cloud BYOC、TiDB Cloud Filesystem、PostgreSQL-compatible TiDB Cloud Starter がパブリックプレビュー中。このページは自動翻訳されたものです。原文はこちらからご覧ください。

REFRESH SPATIAL INDEX



TiDB Cloud Lake は、新しいデータが書き込まれるたびに、SYNC モードの空間インデックスを自動的に更新します。REFRESH SPATIAL INDEX は主に、インデックスが宣言される前から存在していた行をバックフィルするために使用します。

構文

REFRESH SPATIAL INDEX <index> ON [<database>.]<table> [LIMIT <limit>]
パラメータ説明
<limit>インデックス更新中に処理する行の最大数を指定します。指定しない場合、テーブル内のすべての行が処理されます。

例

-- Existing table with data loaded before the index was declared CREATE TABLE IF NOT EXISTS stores ( store_id INT, location GEOMETRY ) ENGINE = FUSE; INSERT INTO stores VALUES (1, TO_GEOMETRY('POINT(10 10)')), (2, TO_GEOMETRY('POINT(20 20)')); -- Create the spatial index afterward CREATE SPATIAL INDEX stores_location_idx ON stores(location); -- Backfill historical rows so the index covers earlier inserts REFRESH SPATIAL INDEX stores_location_idx ON stores; -- Future inserts refresh automatically in SYNC mode

このページは役に立ちましたか?