- def _create_pending_index(self, conn: Connection, tablespace: str) -> None:
- """ Add a supporting index for finding places still to be indexed.
-
- This index is normally created at the end of the import process
- for later updates. When indexing was partially done, then this
- index can greatly improve speed going through already indexed data.
- """
- if conn.index_exists('idx_placex_pendingsector'):
- return
-
- with conn.cursor() as cur:
- LOG.warning('Creating support index')
- if tablespace:
- tablespace = 'TABLESPACE ' + tablespace
- cur.execute(f"""CREATE INDEX idx_placex_pendingsector
- ON placex USING BTREE (rank_address,geometry_sector)
- {tablespace} WHERE indexed_status > 0
- """)
- conn.commit()
-
-