Skip to content

feat: geocode performance#304

Closed
joaquimds wants to merge 2 commits intomainfrom
feat/read-replica-for-geocoding
Closed

feat: geocode performance#304
joaquimds wants to merge 2 commits intomainfrom
feat/read-replica-for-geocoding

Conversation

@joaquimds
Copy link
Member

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a dedicated read-replica database connection for expensive geocode lookups and tweaks default map configuration for an example organisation map.

Changes:

  • Add a second Kysely instance (dbRead) backed by a read-replica pg pool, sharing the existing plugin stack.
  • Switch the expensive findAreasByPoint query to use the read replica while keeping other queries on the primary.
  • Update the example organisation map view to use a default calculation type and explicitly enable the choropleth layer.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/server/services/database/index.ts Defines a read-replica Pool, corresponding PostgresDialect, shared plugin list, and exports a new dbRead Kysely instance alongside the existing db.
src/server/repositories/Area.ts Updates findAreasByPoint to run against dbRead instead of db to offload this heavy spatial read from the primary.
src/server/commands/ensureOrganisationMap.ts Uses DEFAULT_CALCULATION_TYPE for the map view’s calculationType and explicitly sets showChoropleth: true in the created example view config.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@joaquimds joaquimds changed the title feat: add read replica for expensive geocode query feat: geocode performance Feb 4, 2026
@joaquimds joaquimds closed this Feb 4, 2026
@joaquimds joaquimds deleted the feat/read-replica-for-geocoding branch February 5, 2026 11:28
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