Skip to content

fix: resolve project search OR precedence bug and optimize count quer…#7277

Open
prabinoid wants to merge 2 commits into
developfrom
feat/project-list-optimization
Open

fix: resolve project search OR precedence bug and optimize count quer…#7277
prabinoid wants to merge 2 commits into
developfrom
feat/project-list-optimization

Conversation

@prabinoid

@prabinoid prabinoid commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation
  • 🧑‍💻 Refactor
  • ✅ Test
  • 🤖 Build or CI
  • ❓ Other (please specify)

Related Issue

Project search causing DB overload.

Describe this PR

  • Fixes a SQL operator precedence bug in the project search query where the
    OR name ILIKE condition was missing parentheses, causing it to scan project
    names across all locales instead of being scoped to the user's requested
    locale. Under concurrent load, this turns into a full table scan
    storm on project_info that affects performance.

  • Speeds up the project list, especially when the map is shown. Before, the app
    loaded the full details of every matching project just to display map dots
    and one page of results. Now it loads only the lightweight bits needed for the
    map, and asks the database for just the page of results being shown.

  • Removes repeated database calls when building each page. The list used to make
    several small queries per project (around 50+ for a single page); these are
    now combined into a handful of queries, cutting down round-trips.

  • Adds a migration with a composite index on projects(status, private)
    present in every search query's WHERE clause but previously unindexed — and a
    single index on projects(priority) for the default ORDER BY on every page
    load.

…ups, and fix org-filter count query regression
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant