Skip to content

Conversation

@lonvia
Copy link
Member

@lonvia lonvia commented Jan 12, 2026

This adds NOT NULL and UNIQUE constraints to SQL tables consistently were possible. These constraints may allow PostgreSQL to optimise execution and helps catching subtle errors in the SQL code. The PR includes some fixes for these kinds of errors:

  • importance wasn't set where our secondary importance raster has holes
  • array_merge() would sometimes return null, leaving name or address vector null
  • search_name no longer contains any entries with an empty name vector
  • suspicious country areas are now ignored in the location_area tables

The PR also makes sure that indexed_status is only set to 1 when a place is newly added. This allows to skip deleting data from secondary tables for new data, shaving off about 5% of the import time.

Finally fixes an issue in the BDD test with the randomly generated names sometimes not being valid and improves termination when an error occurs during indexing.

@lonvia lonvia merged commit 7e44256 into osm-search:master Jan 14, 2026
8 checks passed
@lonvia lonvia deleted the more-table-constraints branch January 14, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant