docs: how to parallelise a narrow sap_read_table extract, and what it is worth - #132
Closed
jrosskopf wants to merge 1 commit into
Closed
docs: how to parallelise a narrow sap_read_table extract, and what it is worth#132jrosskopf wants to merge 1 commit into
jrosskopf wants to merge 1 commit into
Conversation
… is worth sap_read_table parallelises per COLUMN -- one concurrent RFC_READ_TABLE call per projected column. That is a good fit for a wide extract and no help at all for a narrow one: a single-column scan issues one call and `threads` has nothing to spread. Nothing said so, so the natural reaction to a slow narrow extract was to raise `threads` and watch it change nothing. Documents the range-partition recipe that works today with no code, now that #128 pushes range predicates to SAP so each branch reads only its slice. States what it is actually worth rather than implying the branch count: measured on a 164,664-row single-column extract, four branches ran in 6.6s against 8.3s for the single scan -- about 1.2x, not 4x. Each branch pays its own connection and metadata round-trip and SAP evaluates each range separately, so splitting into many small branches makes it worse. Even boundaries and an indexed split key matter more than how many branches there are. Also notes that separate processes scale considerably better than either approach, since SAP-side concurrency limits apply per client program -- with the caveat to ask Basis before pointing many parallel readers at production.
Collaborator
Author
|
Superseded by #133, which implements The measurement here — 1.24x from a The documentation lands in #133 in updated form: it now points at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes plan step 3.2 (RFC row-range partitioning) — evaluated, decided, documented.
The gate could not be satisfied, so I measured the proxy
The plan conditioned the refactor on "run Phase 0's scaling curve on production-class
hardware first". That hardware is not available. What could be measured is whether
splitting a narrow scan into row ranges helps at all.
DD02L, 164,664 rows, single column, three alternating runs each. Identical checksums
in both arms (2,719,013), so the comparison is valid:
1.24x, not 4x.
Confounded in both directions — the split arm pays four connection setups and makes
SAP evaluate four range filters, while a real in-scanner implementation would share
one setup and use
ROWSKIPS. So this is suggestive, not decisive. It was also takenon a trial under load average ~21.
Why I did not do the refactor
column_state_machineslives in the bind data, shared across the whole scan.Row-range partitioning needs them per worker, which means moving them into a local
state and reworking
Step(), the batch budget, the persistent-connection cache,progress reporting,
ActivateColumns(), the lock-step invariantAreActiveStateMachineCaridnalitiesEqual(),HasMoreResults(), and theresidual-filter application.
That is a re-architecture of the scan path in which this same session found two
silent wrong-results bugs — unapplied predicates, and truncation on a fully-filtered
batch. Against a measured 1.24x that cannot be soak-tested on a shared trial, that
trade does not look good.
The structural gap is real either way: a single-column extract gets no parallelism
at all. It is the payoff that is unproven, not the gap. A scaling curve on a
production-class system showing the knee well above 3 would reverse this.
What this PR delivers instead
The plan's own "either way" item — the recipe that works today with no code:
threadsdoes nothing for a narrow extract (parallelism is per column;one column means one call and nothing to spread). Nothing said so, so the natural
reaction to a slow narrow extract was to raise
threadsand watch it change nothing.branch reads only its slice rather than filtering locally.
small branches make it worse.
sets the wall time) and an indexed split key (otherwise you multiply the server's
work rather than divide it).
SAP-side concurrency limits apply per client program — with the caveat to ask Basis
before pointing many parallel readers at production.
Docs only; no code changes.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.