Skip to content

fix(sql): Correct created filters#142

Merged
devsjc merged 4 commits intomainfrom
devsjc/created-limit
Mar 26, 2026
Merged

fix(sql): Correct created filters#142
devsjc merged 4 commits intomainfrom
devsjc/created-limit

Conversation

@devsjc
Copy link
Copy Markdown
Contributor

@devsjc devsjc commented Mar 26, 2026

Contribution Checklist

  • Have you followed the Open Climate Fix Contribution Guidelines?
  • Have you referenced the Issue this PR addresses, where applicable?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added a summary of the changes?
  • Have you written new tests for your changes, where applicable?
  • Have you successfully run make lint with your changes locally?
  • Have you successfully run make test with your changes locally?

Warning

PRs may be closed if all the above boxes are not checked.

Changes in this Pull Request

Modifies the queries such that the CreatedAt filter is based on created time, not init time.

@devsjc devsjc force-pushed the devsjc/created-limit branch from c5289e8 to 9ae22c9 Compare March 26, 2026 11:04
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 26, 2026

Benchmark Results

Benchmark results
?   	github.com/openclimatefix/data-platform/cmd	[no test files]
?   	github.com/openclimatefix/data-platform/internal/gen/ocf/dp	[no test files]
?   	github.com/openclimatefix/data-platform/internal/interceptors	[no test files]
PASS
ok  	github.com/openclimatefix/data-platform/internal/server/dummy	0.005s
{"level":"debug","time":"2026-03-26T12:16:19Z","message":"Completed migrations"}
goos: linux
goarch: amd64
pkg: github.com/openclimatefix/data-platform/internal/server/postgres
cpu: AMD EPYC 7763 64-Core Processor                
BenchmarkPostgresClient/small/GetForecastAsTimeseries-4         	      70	  15643096 ns/op
BenchmarkPostgresClient/small/GetForecastAtTimestamp-4          	     280	   4105929 ns/op
BenchmarkPostgresClient/small/GetObservationsAsTimeseries-4     	     922	   1249685 ns/op
BenchmarkPostgresClient/small/CreateForecast-4                  	      91	  12811045 ns/op
PASS
ok  	github.com/openclimatefix/data-platform/internal/server/postgres	71.630s
?   	github.com/openclimatefix/data-platform/internal/server/postgres/gen	[no test files]
Benchmark vs base branch
goos: linux
goarch: amd64
pkg: github.com/openclimatefix/data-platform/internal/server/postgres
cpu: AMD EPYC 7763 64-Core Processor                
                                                   │ bench-main.txt │    bench-devsjc-created-limit.txt    │
                                                   │     sec/op     │    sec/op     vs base                │
PostgresClient/small/GetForecastAsTimeseries-4         16.55m ± ∞ ¹   15.64m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/GetForecastAtTimestamp-4          4.090m ± ∞ ¹   4.106m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/GetObservationsAsTimeseries-4     1.249m ± ∞ ¹   1.250m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/CreateForecast-4                  13.62m ± ∞ ¹   12.81m ± ∞ ¹       ~ (p=1.000 n=1) ²
geomean                                                5.825m         5.663m        -2.78%
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05

@devsjc devsjc force-pushed the devsjc/created-limit branch from dcecd6c to a7a788a Compare March 26, 2026 12:13
@devsjc devsjc merged commit ceb5b52 into main Mar 26, 2026
4 checks passed
@devsjc devsjc deleted the devsjc/created-limit branch March 26, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant