Skip to content

Commit

Permalink
Merge pull request #5 from NetherlandsForensicInstitute/bugfix/remove…
Browse files Browse the repository at this point in the history
…_limit_in_queries

Remove LIMIT from queries
  • Loading branch information
Carly-1 authored Oct 31, 2024
2 parents de2054a + 14fef7f commit da57d9e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions copietje/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,11 @@ def make_index(self, zip_file: str):
with ZipFile(zip_file) as documents_zip:
cur = self.database.cursor()

# LIMIT should be removed in final script
cur.execute("""
SELECT path, uid, stream, minhash
FROM documents
WHERE tags IS NOT NULL
ORDER BY size ASC
LIMIT 200
ORDER BY uid ASC
""")
for row in cur:
if minhash := self._get_or_update_minhash(row, documents_zip):
Expand All @@ -111,13 +109,11 @@ def query_index(self, zip_file: str) -> Iterable[Tuple[str, Iterable[Tuple[str,
with ZipFile(zip_file) as documents_zip:
cur = self.database.cursor()

# LIMIT should be removed in final script
cur.execute("""
SELECT path, uid, stream, minhash
FROM documents
WHERE tags IS NULL
ORDER BY size ASC
LIMIT 200
ORDER BY uid ASC
""")
for row in cur:
if query_hash := self._get_or_update_minhash(row, documents_zip):
Expand Down

0 comments on commit da57d9e

Please sign in to comment.