An Azure managed PostgreSQL database service for app development and deployment.
Hello Geoff Fletcher,
It sounds like you’re running into TOAST-table corruption when using DiskANN’s Product Quantization (PQ) mode for vector inserts. In PQ mode your vectors get chunked and stored in a pg_toast table, and it looks like some chunks are going missing or getting orphaned—hence the “missing chunk number 0” error in pg_toast_27911. You said disabling PQ makes ingestion succeed, and rebuilding the index temporarily fixes it, but it recurs after deletes + index rebuild.
Here are a few things to try and investigate:
Vacuum / bloat on the TOAST table
- After big deletes, pg_toast_xxxx can accumulate dead chunks. If autovacuum isn’t keeping up, you’ll see orphaned TOAST entries.
- Run a manual
VACUUM (FULL, ANALYZE)on the base table (or directly on pg_toast_27911) to compact and reclaim space.- Consider using
pg_repackto defragment without downtime.
- Verify autovacuum is active on your database and that there aren’t long-running transactions holding old snapshots (which block TOAST cleanup). - Monitor `pg_stat_progress_vacuum` for the toast table. If it never fires, you may need to tune `autovacuum_vacuum_cost_delay`, `autovacuum_work_mem`, or increase `autovacuum_max_workers`. Confirm index rebuild actually cleans up TOAST - A plain `REINDEX` may not reclaim all orphaned toast chunks. Pair it with `VACUUM FULL` or drop & recreate the table to be sure. Check DiskANN/PQ versions and known bugs - There have been reports of missing‐chunk issues in earlier PQ implementations. If you’re not on the latest DiskANN build, try upgrading. - As a temporary workaround, use a flat index or quantizedFlat mode to see if the behavior changes. Inspect server logs around inserts - Look for any autovacuum errors or disk-IO warnings. - Verify there’s no out-of-disk or resource exhaustion happening right before your final batch fails. - Consider using
- Run a manual
Hopefully one of those steps uncovers the culprit. If the issue persists, we can dig deeper once we have more details.