Skip to content

feat: filter performance improvements #878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/backend/src/checks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ export const CHECK_RUNNERS: CheckRunner[] = [
if (!tokens) return sql`true`;

if (field === "total") {
return sql`completion_tokens + prompt_tokens ${postgresOperators(
return sql`r.prompt_tokens + r.completion_tokens ${postgresOperators(
operator,
)} ${tokens}`;
} else {
Expand Down
5 changes: 5 additions & 0 deletions packages/db/0086.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
drop index if exists run_project_id_cost_idx;

insert into _db_migration_async (name, operation, statement) values
('run_project_id_template_version_id_idx', 'create', 'create index concurrently if not exists run_project_id_template_version_id_idx on run (project_id, template_version_id)'),
('run_project_name_created_at_desc_idx', 'create', 'create index concurrently if not exists run_project_name_created_at_desc_idx on run (project_id, name, created_at desc nulls last)');
Loading