FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
How Exposed Postgres view Took 8 Minutes to Retrieve data
How-ToWeb Development

How Exposed Postgres view Took 8 Minutes to Retrieve data

via Dev.to WebdevMichael Interface1mo ago

To keep production traffic isolated from heavy reporting queries, we maintain a separate analytics database. Our main service database handles user traffic, while a dedicated analytics database aggregates and enriches organization data. Twice a day, a background job synchronizes data from analytics into the service database. The analytics team exposes a PostgreSQL view as a clean interface — no direct table access, just a stable SELECT contract. It worked perfectly. Until one day the sync started taking 8 minutes . And the query had a LIMIT 5000 . The Setup Here’s roughly how the data flowed: On the analytics side, we had something like this: analytics.organizations analytics.organization_domains analytics.partner_organizations analytics.custom_projects The analytics team exposed a view: CREATE VIEW analytics . v_sync_organizations AS SELECT ... FROM analytics . organizations UNION ALL SELECT ... FROM analytics . partner_organizations UNION ALL SELECT ... FROM analytics . custom_projec

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
16 views

Related Articles

How-To

The Difference between `let`, `var` and `const`

Medium Programming • 2d ago

How-To

Circulation Metrics Framework for Living Systems

Medium Programming • 2d ago

Red Rooms makes online poker as thrilling as its serial killer
How-To

Red Rooms makes online poker as thrilling as its serial killer

The Verge • 2d ago

Don’t Know What Project to Build? Here Are Developer Projects That Actually Make You Better
How-To

Don’t Know What Project to Build? Here Are Developer Projects That Actually Make You Better

Medium Programming • 2d ago

Why Most Developers
Stay Broke
How-To

Why Most Developers Stay Broke

Medium Programming • 2d ago

Discover More Articles