Skip to content

Commit 257eab5

Browse files
committed
fix(table): keep timeout guidance to sorts and range filters
1 parent 908617f commit 257eab5

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

  • apps/sim/lib/table/application

‎apps/sim/lib/table/application/rows.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -506,18 +506,18 @@ async function throwValidationResponse(
506506
}
507507

508508
/**
509-
* A structured row query cancelled by its own `statement_timeout`. Sorting, range-filtering, or
510-
* counting on a stored column reads every row's full data, so on a large table the query only
511-
* finishes when that data happens to be cached. The fix is the caller's (narrow the query), so this
512-
* is a 400 with an actionable message rather than an opaque 500.
509+
* A structured row query cancelled by its own `statement_timeout`. Sorting or range-filtering on a
510+
* stored column reads every candidate row's full data, so on a large table the query only finishes
511+
* when that data happens to be cached. The fix is the caller's (narrow the query), so this is a 400
512+
* with an actionable message rather than an opaque 500.
513513
*/
514514
function rethrowReadQueryError(error: unknown, tableId: string): never {
515515
if (getPostgresCancellationReason(error) === 'statement_timeout') {
516516
logger.warn('Table read hit its statement timeout', { tableId })
517517
throw new TableRowsValidationError(
518518
`The query took longer than ${READ_STATEMENT_TIMEOUT_MS / 1000} seconds and was stopped. ` +
519-
'Sorting, range-filtering, or counting on a column reads every row in the table, which ' +
520-
'is too slow at this table size. Sort by createdAt, add an equality filter, or keep ' +
519+
'Sorting or range-filtering on a column reads every row in the table, which is too slow ' +
520+
'at this table size. Sort by createdAt, add an equality filter, or keep ' +
521521
'fewer rows (an Expiration column deletes old rows automatically).',
522522
{ code: 'TABLE_QUERY_TIMEOUT' }
523523
)

0 commit comments

Comments
 (0)