Uploading several graphs rebuilds the derived computed graph after every write #16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After every successful graph write,
put_graphinsrc/routes/ingest.rscallsauto_recompute, which clears the dataset's derivedcomputedgraph and re-derives it from all source graphs, to a fixpoint, before it replies. A client that writes n graphs in a row pays for n full rebuilds, and only the last one is useful.On a real upload of six graphs (schema 67 KB, kg 13.3 MB, labels 2.4 MB, wikidata 104 KB, cq 16 KB, doc), most of the time goes to these repeated rebuilds, not to loading. The cost grows with the dataset: the largest graph grew from about 57k to about 171k triples between two uploads.
Proposed change
Let a client defer the rebuild, then recompute once.
PUT,POSTandDELETEon_graphaccept?recompute=false, or a request header such asConcon-Recompute: defer, which skips the automatic rebuild for that write.POST _recomputeonce after the last write.computedcoherent, so single-graph writes need nothing from the client.Also log the rebuild's duration in the existing "recomputed derived graph" log line, so slow uploads can be diagnosed.
Alternatives considered:
computedis briefly stale after a write, and readers would need a way to see that a rebuild is pending.Acceptance
POST _recompute, perform exactly one rebuild (test)computedcoherent, as todaydocs/, with an upload example