Skip to content

OTWO-7664 Investigate PG::QueryCanceled: Statement Timeout Error#1906

Open
bd-vaibhav wants to merge 1 commit into
mainfrom
OTWO-7664
Open

OTWO-7664 Investigate PG::QueryCanceled: Statement Timeout Error#1906
bd-vaibhav wants to merge 1 commit into
mainfrom
OTWO-7664

Conversation

@bd-vaibhav

Copy link
Copy Markdown
Contributor

No description provided.

@bd-vaibhav bd-vaibhav force-pushed the OTWO-7664 branch 2 times, most recently from 00fe69c to 3e4fe2f Compare June 17, 2026 14:19
@bd-vaibhav bd-vaibhav requested a review from Copilot June 18, 2026 10:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR appears aimed at investigating/mitigating PG::QueryCanceled: statement timeout issues by changing how commits are queried for an analysis, and it also updates the PostgreSQL structure.sql dump.

Changes:

  • Updates Commit.by_analysis query composition (joins/filters) to change how commits are scoped to an analysis.
  • Regenerates db/structure.sql, including dump header/encoding changes and modified schema_migrations insert section.

Reviewed changes

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

File Description
db/structure.sql Updated DB structure dump; currently includes header/encoding/meta-command changes and altered schema_migrations inserts.
app/models/commit.rb Modifies Commit.by_analysis scope to use different joins and precomputed sloc_set_ids.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/models/commit.rb
Comment on lines 19 to 25
scope :by_analysis, lambda { |analysis|
joins(code_set: [sloc_sets: :analysis_sloc_sets])
sloc_set_ids = analysis.sloc_sets.pluck(:id)
joins(code_set: :sloc_sets)
.where(sloc_sets: { id: sloc_set_ids })
.joins('INNER JOIN analysis_sloc_sets ON analysis_sloc_sets.sloc_set_id = sloc_sets.id')
.joins('and commits.position <= analysis_sloc_sets.as_of')
.where(analysis_sloc_sets: { analysis_id: analysis.id })
@Priya5 Priya5 added the Don't merge No CI tasks will run label Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Don't merge No CI tasks will run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants