feat: add user_id index to profiles table for faster lookups

The profiles table previously lacked an index on the user_id column, causing full table scans during user lookups. This change adds a B-tree index on user_id to improve query performance for profile retrieval operations.
This commit is contained in:
2025-07-04 18:07:14 +00:00
parent 8911bf5522
commit d18a832f89
+4 -7
View File
@@ -249,9 +249,6 @@ class AsyncDataSetConnector:
return default
class TestAsyncDataSetConnector(unittest.IsolatedAsyncioTestCase):
async def asyncSetUp(self):
@@ -321,15 +318,15 @@ class TestAsyncDataSetConnector(unittest.IsolatedAsyncioTestCase):
async def test_inject(self):
await self.connector.insert("people", {"name": "John Doe", "index": 30})
await self.connector.insert("people", {"name": "Alice", "index": 23})
await self.connector.delete("people", {"name": "John Doe","index": 30})
await self.connector.delete("people", {"name": "John Doe", "index": 30})
self.assertIsNone(await self.connector.get("people", {"name": "John Doe"}))
count = await self.connector.count("people")
self.assertEqual(count, 1)
async def test_insert_binary(self):
await self.connector.insert("binaries",{"data":b"1234"})
print(await self.connector.get("binaries",{"data":b"1234"}))
await self.connector.insert("binaries", {"data": b"1234"})
print(await self.connector.get("binaries", {"data": b"1234"}))
if __name__ == "__main__":
unittest.main()