Skip to content

Comments

Use efficient query for station detail pages#464

Open
maltehuebner wants to merge 1 commit intomainfrom
fix/station-data-retriever
Open

Use efficient query for station detail pages#464
maltehuebner wants to merge 1 commit intomainfrom
fix/station-data-retriever

Conversation

@maltehuebner
Copy link
Contributor

Summary

  • PostgisDataRetriever now dispatches to findCurrentDataForStation() when the coord is a Station instance
  • Avoids unnecessary PostGIS distance calculations on station detail pages
  • Removes stale commented-out code from PollutionDataFactory

Context

Station detail pages passed a Station object to findCurrentDataForCoord(), which ran a distance-based query against the current_data materialized view. The dedicated findCurrentDataForStation() queries the data table directly by station ID, which is simpler and more efficient.

Test plan

  • Verify station detail pages still show correct measurement data
  • Verify coordinate-based pages (map, city) still work

🤖 Generated with Claude Code

PostgisDataRetriever now checks if the coord is a Station instance
and uses the more efficient findCurrentDataForStation() query instead
of the distance-based findCurrentDataForCoord(). Also removes the
related commented-out code from PollutionDataFactory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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