From 8952d70fd224963739a1af2668d580fc9d5b99b7 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 10 Sep 2026 16:45:22 +0200 Subject: [PATCH 1/2] :zap: Optimize get-profiles-for-file-comments query (#11622) Rewrite sql:file-comment-users to join comment with comment_thread and union the requesting profile id, then join the resulting small id set against profile. The previous "id IN (subquery) OR id = ?" forced a sequential scan over the whole profile table with a hashed subplan filter, taking ~1.9s on large instances. The semi-join lets the planner use profile_pkey, dropping the query to sub-millisecond time. UNION (not UNION ALL) keeps the previous dedup semantics when the requesting profile is also a commenter. AI-assisted-by: deepseek-flash --- backend/src/app/rpc/commands/comments.clj | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/backend/src/app/rpc/commands/comments.clj b/backend/src/app/rpc/commands/comments.clj index b9c6002eb4..6e5c8f76dc 100644 --- a/backend/src/app/rpc/commands/comments.clj +++ b/backend/src/app/rpc/commands/comments.clj @@ -390,18 +390,26 @@ (def ^:private sql:file-comment-users "WITH available_profiles AS ( - SELECT DISTINCT owner_id AS id - FROM comment - WHERE thread_id IN (SELECT id FROM comment_thread WHERE file_id=?) + SELECT DISTINCT c.owner_id AS id + FROM comment c + JOIN comment_thread ct + ON ct.id = c.thread_id + WHERE ct.file_id = ?::uuid + ), + profile_ids AS ( + SELECT id FROM available_profiles + UNION + SELECT ?::uuid ) SELECT p.id, p.email, p.fullname AS name, - p.fullname AS fullname, + p.fullname, p.photo_id, p.is_active - FROM profile AS p - WHERE p.id IN (SELECT id FROM available_profiles) OR p.id=?") + FROM profile p + JOIN profile_ids AS x + ON x.id = p.id;") (defn get-file-comments-users [conn file-id profile-id] From bae390053791e1ddd1ab3a177f73f8db4c8c8751 Mon Sep 17 00:00:00 2001 From: bameda Date: Thu, 10 Sep 2026 15:35:57 +0000 Subject: [PATCH 2/2] :recycle: Rebalance CI runners and drop pinned ubuntu-24.04 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move build-docker and build-docker-devenv jobs from penpot-extended-runner to penpot-standar-runner, point tests-exporter at the canonical penpot-extended-runner label instead of the stale penpot-runner-02 alias, and switch build-tag/release notify jobs from ubuntu-24.04 to ubuntu-latest. Signed-off-by: David Barragán Merino --- .github/workflows/build-docker-devenv.yml | 2 +- .github/workflows/build-docker.yml | 8 ++++---- .github/workflows/build-tag.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/tests-exporter.yml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-docker-devenv.yml b/.github/workflows/build-docker-devenv.yml index 53de6376ce..2eab6be51e 100644 --- a/.github/workflows/build-docker-devenv.yml +++ b/.github/workflows/build-docker-devenv.yml @@ -6,7 +6,7 @@ on: jobs: build-and-push: name: Build and push DevEnv Docker image - runs-on: penpot-extended-runner + runs-on: penpot-standar-runner steps: - name: Set common environment variables diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index ade22b78d1..d4c79c92a7 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -46,7 +46,7 @@ jobs: # ── 1. Resolve the build key and check the whole set at once ─────────── prepare: name: Prepare - runs-on: penpot-extended-runner + runs-on: penpot-standar-runner timeout-minutes: 15 outputs: gh_ref: ${{ steps.vars.outputs.gh_ref }} @@ -135,7 +135,7 @@ jobs: # ── 2. One build per image, in parallel, only when needed ────────────── build: name: Build ${{ matrix.image }} - runs-on: penpot-extended-runner + runs-on: penpot-standar-runner timeout-minutes: 60 needs: prepare if: needs.prepare.outputs.exists == 'false' @@ -248,7 +248,7 @@ jobs: # the S3 marker guarantees the branch tags were already moved. promote: name: Promote image set - runs-on: penpot-extended-runner + runs-on: penpot-standar-runner timeout-minutes: 10 needs: [prepare, build] @@ -302,7 +302,7 @@ jobs: # ── 4. Single failure notification for the whole workflow ───────────── notify: name: Notify failure - runs-on: penpot-extended-runner + runs-on: penpot-standar-runner timeout-minutes: 5 needs: [prepare, build, promote] if: failure() diff --git a/.github/workflows/build-tag.yml b/.github/workflows/build-tag.yml index bfa30fb67b..ed79d398f9 100644 --- a/.github/workflows/build-tag.yml +++ b/.github/workflows/build-tag.yml @@ -46,7 +46,7 @@ jobs: notify: name: Notifications - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest needs: - build-docker - build-docker-admin-console diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 47305864f2..2c00f841ff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ permissions: jobs: release: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest outputs: version: ${{ steps.vars.outputs.gh_ref }} release_notes: ${{ steps.extract_release_notes.outputs.release_notes }} diff --git a/.github/workflows/tests-exporter.yml b/.github/workflows/tests-exporter.yml index 1ed37d95c8..ed5c17883a 100644 --- a/.github/workflows/tests-exporter.yml +++ b/.github/workflows/tests-exporter.yml @@ -32,7 +32,7 @@ jobs: test-exporter: if: ${{ !github.event.pull_request.draft }} name: "Exporter Tests" - runs-on: penpot-runner-02 + runs-on: penpot-extended-runner container: image: penpotapp/devenv:latest volumes: