Skip to content

Remove execute() function call from TimeseriesDataset.php that runs a duplicate sql statements#2250

Open
eiffel777 wants to merge 2 commits into
ubccr:mainfrom
eiffel777:remove-duplicate-sql-call
Open

Remove execute() function call from TimeseriesDataset.php that runs a duplicate sql statements#2250
eiffel777 wants to merge 2 commits into
ubccr:mainfrom
eiffel777:remove-duplicate-sql-call

Conversation

@eiffel777

@eiffel777 eiffel777 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

The execute() removed in this PR caused the sql statement to be run a second time. $this->agg_query->getRawStatement does return a the statement but that function runs DB::factory($this->_db_profile)->query($query_string, $this->pdoparams, true); and that query function runs $stmt->execute($params) in classes/CCR/DB/PDODB.php line 159.

Motivation and Context

Running the duplicate sql statement is unneeded and will make requests for data take longer. The performance aspect may not be as noticeable when the database query cache is enabled.

Tests performed

In docker, turn on slow log and set slow log to 0 to log all queries. Got to metric explorer and request any statistic. Look at slow log and make sure second group by query does not show up.

Checklist:

  • The pull request description is suitable for a Changelog entry
  • The milestone is set correctly on the pull request
  • The appropriate labels have been added to the pull request

@eiffel777 eiffel777 added this to the 11.5.0 milestone Jun 22, 2026
@eiffel777 eiffel777 self-assigned this Jun 22, 2026
@eiffel777 eiffel777 added bug Bugfixes Category:General General labels Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bugfixes Category:General General

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant