Skip to content

Commit 6509534

Browse files
authored
fix: Improve indexing of the request_queue_records table for SqlRequestQueueClient (#1527)
### Description - This PR improves the index for the `request_queue_records` table, as the previous version of the index was not efficient for retrieving requests. EXPLAIN result for over a million requests Old index <img width="1133" height="573" alt="image" src="https://github.com/user-attachments/assets/6c75d6ac-bd86-4b8e-9abf-3dc897a42ad7" /> New index <img width="1028" height="443" alt="image" src="https://github.com/user-attachments/assets/e79780e8-fba7-42e2-aa47-f70d83e8c372" /> ### Issues - Closes: #1526
1 parent c8e2f19 commit 6509534

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/crawlee/storage_clients/_sql/_db_models.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,8 @@ class RequestDb(Base):
205205
'idx_fetch_available',
206206
'request_queue_id',
207207
'is_handled',
208-
'time_blocked_until',
209208
'sequence_number',
210-
postgresql_where=text('is_handled = false'),
209+
postgresql_where=text('is_handled is false'),
211210
),
212211
)
213212

0 commit comments

Comments
 (0)