Bound paged retrieval responses
This commit is contained in:
parent
176b2d2784
commit
529accf858
15 changed files with 1567 additions and 30 deletions
|
|
@ -378,6 +378,27 @@ class DocForgeCoreTests(unittest.TestCase):
|
|||
operation()
|
||||
self.assertEqual("invalid_limit", invalid.exception.code)
|
||||
|
||||
def test_incoming_traversal_uses_source_ordered_covering_index(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = self.copy_fixture("alpha", Path(directory))
|
||||
index = ProjectIndex(Project.open(root))
|
||||
index.build()
|
||||
|
||||
connection = sqlite3.connect(index.path)
|
||||
try:
|
||||
plan = connection.execute(
|
||||
"EXPLAIN QUERY PLAN "
|
||||
"SELECT source_id, relation, target_id FROM edges "
|
||||
"WHERE target_id = ? "
|
||||
"ORDER BY source_id, relation, target_id LIMIT ?",
|
||||
("guide.foundation", 101),
|
||||
).fetchall()
|
||||
finally:
|
||||
connection.close()
|
||||
details = " ".join(str(row[3]) for row in plan)
|
||||
self.assertIn("edges_target_source", details)
|
||||
self.assertNotIn("USE TEMP B-TREE", details)
|
||||
|
||||
def test_query_rechecks_source_identity_before_returning(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = self.copy_fixture("alpha", Path(directory))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue