Replace the window-function full-table scan with a two-phase approach
that leverages search_key_value_entity_idx (key, value, entity_id):
Phase 1: GROUP BY entity_id, key, value with HAVING COUNT(*) > 1
resolves as a pure index-only scan (Heap Fetches: 0).
Stores only the duplicate groups in a temp table (~8s for
a 14M-row table with 700k dupes).
Phase 2: CROSS JOIN LATERAL back into search using the same covering
index (Nested Loop + Index Scan). row_number() runs per-group
over the 2-3 matching rows, so there is no global external
sort. A single DELETE removes all extras in one statement
(~16s).
NULL values get a separate UNION ALL arm so the index equality
condition stays usable (value = NULL is always false in SQL).
Benchmarked on a 14.4M-row production-like staging master with
700k injected duplicates, post-VACUUM:
Old (seq scan + external merge sort): ~101s
New (index-only + index scan): ~25s (~4× faster)
Clean second run (no dupes, fast path skips dedup): <50ms.
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Backstage
English | 한국어 | 中文版 | Français
What is Backstage?
Backstage is an open source framework for building developer portals. Powered by a centralized software catalog, Backstage restores order to your microservices and infrastructure and enables your product teams to ship high-quality code quickly without compromising autonomy.
Backstage unifies all your infrastructure tooling, services, and documentation to create a streamlined development environment from end to end.
Out of the box, Backstage includes:
- Backstage Software Catalog for managing all your software such as microservices, libraries, data pipelines, websites, and ML models
- Backstage Software Templates for quickly spinning up new projects and standardizing your tooling with your organization’s best practices
- Backstage TechDocs for making it easy to create, maintain, find, and use technical documentation, using a "docs like code" approach
- Plus, a growing ecosystem of open source plugins that further expand Backstage’s customizability and functionality
Backstage was created by Spotify but is now hosted by the Cloud Native Computing Foundation (CNCF) as an Incubation level project. For more information, see the announcement.
Project roadmap
For information about the detailed project roadmap including delivered milestones, see the Roadmap.
Getting Started
To start using Backstage, see the Getting Started documentation.
Documentation
The documentation of Backstage includes:
- Main documentation
- Software Catalog
- Architecture (Decisions)
- Designing for Backstage
- Storybook - UI components
Community
To engage with our community, you can use the following resources:
- Discord chatroom - Get support or discuss the project
- Contributing to Backstage - Start here if you want to contribute
- RFCs - Help shape the technical direction
- FAQ - Frequently Asked Questions
- Code of Conduct - This is how we roll
- Adopters - Companies already using Backstage
- Blog - Announcements and updates
- Newsletter - Subscribe to our email newsletter
- Backstage Community Sessions - Join monthly meetups and explore Backstage community
- Give us a star ⭐️ - If you are using Backstage or think it is an interesting project, we would love a star ❤️
Governance
See the GOVERNANCE.md document in the backstage/community repository.
License
Copyright 2020-2026 © The Backstage Authors. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our Trademark Usage page: https://www.linuxfoundation.org/trademark-usage
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
Security
Please report sensitive security issues using Spotify's bug-bounty program rather than GitHub.
For further details, see our complete security release process.

