Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the speed of FAISSDocumentStore.delete_documents() #1095

Merged
merged 1 commit into from
May 26, 2021
Merged

Improve the speed of FAISSDocumentStore.delete_documents() #1095

merged 1 commit into from
May 26, 2021

Conversation

akkefa
Copy link
Contributor

@akkefa akkefa commented May 25, 2021

fixed #647

Database Delete benchmark

Current delete query took 12 m 54 s 892 ms on 10000000 records

DELETE FROM document WHERE document.id IN (SELECT document.id
                                                           FROM document
                                                           WHERE document.index = 'doc')

Updated delete query took 1 m 26 s 147 ms on 10000000 records

DELETE FROM document WHERE document.index = 'doc'

Sample data generation query:

insert into document ( id, text, index ) select s, md5(random()::text), 'doc' from generate_series(1, 10000000) s(i)

Status (please check what you already did):

  • First draft (up for discussions & feedback)
  • Final code
  • [] Added tests
  • Updated documentation

@akkefa
Copy link
Contributor Author

akkefa commented May 25, 2021

@tholor Please review this pull request.

Copy link
Member

@tholor tholor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the fix!

@tholor tholor merged commit 94f1a2b into deepset-ai:master May 26, 2021
@akkefa akkefa deleted the faiss_delete_documents branch May 26, 2021 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve speed of FAISSDocumentStore.delete_all_documents()
2 participants