You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/sim/lib/workspace-files/search/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Workspace file search
2
2
3
-
PostgreSQL stores complete extracted text in bounded chunks. Object storage remains the source of truth. A source and its extracted UTF-8 text must each fit within 25 MiB. Unsupported, degraded, oversized, or partially extracted files are excluded in full. There is no row-count or line-count coverage limit.
3
+
PostgreSQL stores complete extracted text in bounded chunks. Object storage remains the source of truth. A source and its extracted UTF-8 text must each fit within 25 MiB. Unsupported, degraded, oversized, or partially extracted files are excluded in full. So is text that is mostly an encoded payload: when unbroken base64-alphabet runs of at least 256 characters that mix upper case, lower case, and digits make up half the text and more than 32 KiB, as with binaries stored as base64 text or SVGs embedding data URIs, the file is skipped as `encoded_content`. A run that fills whole lines at least 60 characters wide continues across line breaks, so base64 wrapped at the usual 64 or 76 columns counts as one payload. Smaller encoded values, such as a signature in a config file or lockfile integrity hashes, stay searchable, as do single-case runs such as hex digests and DNA sequences. There is no row-count or line-count coverage limit.
4
4
5
5
## Storage and publication
6
6
@@ -12,7 +12,7 @@ PostgreSQL stores complete extracted text in bounded chunks. Object storage rema
12
12
13
13
Workers download and extract outside database transactions, then insert batches of at most 250 rows / 128 KiB. Each batch checks the build token and lease. Publication locks the canonical file, build, and revision in that order, verifies the stored chunk count, and changes the visible pointer only after every batch succeeds. Old dispatch failure callbacks cannot overwrite newer dispatches or successful builds.
14
14
15
-
The chunk GIN index uses `fastupdate = off`. Each bounded insert updates the main index directly instead of appending to a shared pending list. With deferred updates enabled, even a small insert can cross the pending-list threshold and synchronously merge accumulated work from other files. Direct updates trade some bulk-write throughput for avoiding that foreground cleanup cliff. They do not eliminate normal index I/O, vacuum, or storage contention; the row and worker limits still apply. The 128 KiB batch budget bounds direct index work per transaction without changing the 25 MiB file coverage limit. Dense text with many distinct trigrams and an index working set larger than the available cache can still exceed the statement deadline. Capacity validation must include that cache pressure, not only a small corpus or a row count.
15
+
The chunk GIN index uses `fastupdate = off`. Each bounded insert updates the main index directly instead of appending to a shared pending list. With deferred updates enabled, even a small insert can cross the pending-list threshold and synchronously merge accumulated work from other files. Direct updates trade some bulk-write throughput for avoiding that foreground cleanup cliff. They do not eliminate normal index I/O, vacuum, or storage contention; the row and worker limits still apply. The 128 KiB batch budget bounds direct index work per transaction without changing the 25 MiB file coverage limit. Dense text with many distinct trigrams and an index working set larger than the available cache can still exceed the statement deadline. Capacity validation must include that cache pressure, not only a small corpus or a row count. A batch that takes at least two seconds, including one a statement timeout cancels, is logged with its rows, bytes, and estimated trigram key count (pg_trgm's extraction, reproduced exactly for the database's `en_US.UTF-8` ctype), so a key-based batch budget can be sized from production timings. A failed query is reported to the task runner by error code only; Drizzle's message carries the bound file text.
16
16
17
17
Indexing transactions have separate limits from search: ten seconds per statement, five seconds waiting for a lock, and thirty seconds total on PostgreSQL 17. The outer limit leaves time for ordinary statement cancellation and rollback instead of terminating the connection at the same ten-second deadline. PostgreSQL 16 uses the compatible idle-transaction guard. A canceled batch remains unpublished; the existing task retry starts a fresh fenced build, and cleanup retires the previous attempt. This does not automatically retry revisions already marked failed.
0 commit comments