Report how many changes were done in the interface
This commit is contained in:
1 parent
dc978fd0fd
commit
8258bdc2a3
6 files changed
+140
-23
No files matched your search
@@ -1,5 +1,30 @@
|
||||
# Write statistics
|
||||
|
||||
## Status
|
||||
|
||||
Done. Queries that can write report `stats` in the final `PULL` summary, with the
|
||||
node, relationship and label counters exact, and `properties-set` approximate as
|
||||
described below. `CREATE DATABASE` and `DROP DATABASE` report system updates.
|
||||
|
||||
The spike and testing changed some details below:
|
||||
|
||||
- The counters do **not** reset at commit: they stay until PostgreSQL flushes them,
|
||||
some time later. That makes the difference only reliable within one transaction,
|
||||
which is still why each write runs in its own. Before, query and after are sent as
|
||||
one script, so this costs no extra round trips.
|
||||
- The counters are read with `pg_stat_get_xact_tuples_*`, not the
|
||||
`pg_stat_xact_user_tables` view.
|
||||
- Label tables are found through `pg_class` and `pg_inherits`, not `ag_label`: reading
|
||||
`ag_label` made writes fail for roles without `SELECT` on it.
|
||||
- `labels-removed` is not reported. Deleting a node does not count in Neo4j, and AGE
|
||||
cannot remove a label.
|
||||
- `SET n.a = 1, n.b = 2` is one update per node, so `properties-set` is the number of
|
||||
nodes and relationships changed, not of properties.
|
||||
|
||||
The price is about 1 ms per query that can write (2.1 ms to 3.0 ms for a single-row
|
||||
`CREATE` on a local database). A statement that writes many rows pays this once.
|
||||
Caching a graph's label tables could lower it.
|
||||
|
||||
## Problem
|
||||
|
||||
Neo4j reports what a write query changed in the `stats` entry of the final `PULL`
|
||||
|
||||
Reference in new issue
Block a user