Replies: 3 comments 2 replies
|
Thanks for the detailed report — the numbers made the cause easy to pin down. Root cause. The JDBC backend's cursor ( Workaround available right now — shrink the cursor fetch size via a system property (add it to For your directory size this should cut database network traffic by roughly ~20×, at the cost of a few extra round-trips on long sequential scans. Values in the 20–100 range are reasonable; please share what you observe. Proper fix (serving repositioning from the already-fetched buffer + adaptive batch sizing, expected to reduce dn2id scope-scan traffic by ~1000× for one-level searches) is tracked in #860. |
|
tested and experienced the same results. I repeated the test with fetch size 1 and noted about half the network And tables stats: |
|
Great data — this narrows it down a lot. The two query shapes map to two different trees, and the table names are BASEDN='dc=example,dc=com' # your suffix, normalized: lowercase, no spaces after commas
for t in dn2id id2entry id2childrencount referral state; do
printf 'opendj_%s %s\n' "$(printf '%s' "/$BASEDN/$t" | openssl dgst -sha224 -r | cut -d' ' -f1)" "$t"
doneFrom the shapes alone: the 13 MB / ~10k-row table read with The interesting one is the 3.5 MB table with a single row. My bet is Could you post the output of: select count(*) as live_rows, max(octet_length(k)) as max_key, max(octet_length(v)) as max_val
from opendj_89664c245635f826d983b56d437e14c284eefeea28dd3b638bc391c2;
select relname, n_live_tup, n_dead_tup, n_tup_upd, last_autovacuum, last_autoanalyze
from pg_stat_user_tables
where relname in ('opendj_89664c245635f826d983b56d437e14c284eefeea28dd3b638bc391c2',
'opendj_67108e419e0a2f8d03c6b56381be82971d3f5253ba33b13c865e5138');…plus the tree-name mapping from the snippet above? If On the fetchsize numbers: if that table really has 1–2 live rows, its scans return at most 1–2 rows regardless of the limit — fetchsize cannot affect them. So the halving at
If the payload is what remains, the lever is caching rather than cursor tuning: the JE backend feels smooth because its cache is local, while JDBC pays the wire cost for every entry read — enabling the DS entry cache should remove most repeated Finally, the proper fix for the cursor re-fetch (#860) was merged today in #863: forward repositioning is now served from the already-fetched buffer and batches grow adaptively (32 → fetchsize). If you can build |

Thanks for closing the loop — and no worries about the row count. Your numbers actually identify the table conclusively: 13,908 rows with keys ≤78 bytes and 8-byte values is one row per entry — that's
dn2id(key = normalized DN, value = entry ID). So the scan concentration was exactly the #860 re-fetch pattern after all, and my sharded-counter/bloat guess was wrong:n_dead_tup = 0rules out bloat.The hash recipe not matching was my mistake: the normalized form reverses the RDN order (suffix first). For
dc=example,dc=comthe tree name is/dc=com,dc=example/dn2id:(lowercased attribute names, equality-normalized values, RDNs …