From d04390938e5d98660e494149f857eafbc114a2e1 Mon Sep 17 00:00:00 2001 From: Danil Nemirovsky Date: Fri, 6 Dec 2024 14:35:59 +0000 Subject: [PATCH] fix: Add index to cursor table (#4961) ### Description Add index to cursor table so than Scraper starts quickly ### Backward compatibility Yes ### Testing Manual Co-authored-by: Danil Nemirovsky <4614623+ameten@users.noreply.github.com> --- .../src/m20230309_000003_create_table_cursor.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/rust/main/agents/scraper/migration/src/m20230309_000003_create_table_cursor.rs b/rust/main/agents/scraper/migration/src/m20230309_000003_create_table_cursor.rs index 2b50414f81..dd8c1d2e96 100644 --- a/rust/main/agents/scraper/migration/src/m20230309_000003_create_table_cursor.rs +++ b/rust/main/agents/scraper/migration/src/m20230309_000003_create_table_cursor.rs @@ -35,7 +35,20 @@ impl MigrationTrait for Migration { ) .to_owned(), ) - .await + .await?; + + manager + .create_index( + Index::create() + .table(Cursor::Table) + .name("cursor_domain_idx") + .col(Cursor::Domain) + .index_type(IndexType::BTree) + .to_owned(), + ) + .await?; + + Ok(()) } async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {