Skip to content

Commit

Permalink
Add id index to the work queue table
Browse files Browse the repository at this point in the history
Needed to efficiently delete ids during processing.
  • Loading branch information
cevian committed Oct 27, 2023
1 parent 2ae8fa6 commit ace0150
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nbs/01_pgvectorizer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@
" id int\n",
" );\n",
"\n",
" CREATE INDEX ON {self.schema_name}.{self.work_queue_table_name}(id);\n",
"\n",
" CREATE OR REPLACE FUNCTION {self.schema_name}.{self.trigger_name_fn}() RETURNS TRIGGER LANGUAGE PLPGSQL AS $$ \n",
" BEGIN \n",
" IF (TG_OP = 'DELETE') THEN\n",
Expand Down
2 changes: 2 additions & 0 deletions timescale_vector/pgvectorizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def register(self):
id int
);
CREATE INDEX ON {self.schema_name}.{self.work_queue_table_name}(id);
CREATE OR REPLACE FUNCTION {self.schema_name}.{self.trigger_name_fn}() RETURNS TRIGGER LANGUAGE PLPGSQL AS $$
BEGIN
IF (TG_OP = 'DELETE') THEN
Expand Down

0 comments on commit ace0150

Please sign in to comment.