devflowinc / trieve

All-in-one infrastructure for search, recommendations, RAG, and analytics offered via API
https://dashboard.trieve.ai
Other
1.44k stars 123 forks source link

cleanup: modify postgres count trigger function to run once per bulk write #1786

Closed skeptrunedev closed 3 months ago

skeptrunedev commented 3 months ago

Description

Right now if 1000 chunks are added at a single time to postgres, the trigger function runs 1000 times and it should ideally only run once.

We should modify the trigger function such that it only runs one time per bulk write.

Target(s)

server

Requirement to close

PR with postgres migration to modify the trigger function such that it only runs once during a bulk write

Community channels

Matrix is preferred. Reach out on discord or Matrix for further assistance.