Skip to content

Commit 5251d82

Browse files
committed
Add id index to the work queue table
Needed to efficiently delete ids during processing.
1 parent c90db97 commit 5251d82

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

nbs/01_pgvectorizer.ipynb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@
8787
" id int\n",
8888
" );\n",
8989
"\n",
90+
" CREATE INDEX ON {self.schema_name}.{self.work_queue_table_name}(id);\n",
91+
"\n",
9092
" CREATE OR REPLACE FUNCTION {self.schema_name}.{self.trigger_name_fn}() RETURNS TRIGGER LANGUAGE PLPGSQL AS $$ \n",
9193
" BEGIN \n",
9294
" IF (TG_OP = 'DELETE') THEN\n",

timescale_vector/pgvectorizer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ def register(self):
6060
id int
6161
);
6262
63+
CREATE INDEX ON {self.schema_name}.{self.work_queue_table_name}(id);
64+
6365
CREATE OR REPLACE FUNCTION {self.schema_name}.{self.trigger_name_fn}() RETURNS TRIGGER LANGUAGE PLPGSQL AS $$
6466
BEGIN
6567
IF (TG_OP = 'DELETE') THEN

0 commit comments

Comments
 (0)