Skip to content

perf(user_ldap): chunk oracle queries for lower bind cost#60930

Open
miaulalala wants to merge 1 commit into
masterfrom
test/noid/user-ldap-large-annotation
Open

perf(user_ldap): chunk oracle queries for lower bind cost#60930
miaulalala wants to merge 1 commit into
masterfrom
test/noid/user-ldap-large-annotation

Conversation

@miaulalala
Copy link
Copy Markdown
Contributor

@miaulalala miaulalala commented Jun 2, 2026

Oracle's OCI8 driver binds each named parameter individually via
OCIBindByName, making queries with 65 000 parameters dramatically
slower than on MySQL or PostgreSQL — slow enough to time out in CI
and degrade production LDAP syncs on large installations.

Lower maxSlices to 5 for Oracle (5 000 params/query) via a match
expression alongside the existing SQLite special-case. SQLite and
all other databases are unchanged.

🤖 Generated with Claude Code

Assisted-by: ClaudeCode:claude-sonnet-4-6

@miaulalala miaulalala requested a review from a team as a code owner June 2, 2026 09:48
@miaulalala miaulalala requested review from Altahrim, artonge, come-nc, leftybournes, provokateurin and salmart-dev and removed request for a team June 2, 2026 09:48
come-nc
come-nc previously approved these changes Jun 2, 2026
@miaulalala
Copy link
Copy Markdown
Contributor Author

/backport to stable34

@miaulalala miaulalala self-assigned this Jun 2, 2026
@miaulalala miaulalala added 3. to review Waiting for reviews tests Related to tests CI AI assisted labels Jun 2, 2026
@miaulalala miaulalala added this to the Nextcloud 35 milestone Jun 2, 2026
provokateurin
provokateurin previously approved these changes Jun 2, 2026
@miaulalala miaulalala enabled auto-merge June 2, 2026 10:05
@miaulalala miaulalala force-pushed the test/noid/user-ldap-large-annotation branch from bd71bf9 to 7d43864 Compare June 2, 2026 10:54
@come-nc
Copy link
Copy Markdown
Contributor

come-nc commented Jun 2, 2026

It does not work, somehow the timeout is still 300

There was 1 risky test:

1) OCA\User_LDAP\Tests\Mapping\GroupMappingTest::testGetListOfIdsByDn
This test was aborted after 300 seconds

@miaulalala miaulalala force-pushed the test/noid/user-ldap-large-annotation branch from 7d43864 to 3cdeb01 Compare June 3, 2026 06:46
@miaulalala miaulalala changed the title test(user_ldap): mark testGetListOfIdsByDn as Large perf(user_ldap): chunk oracle queries for lower bind cost Jun 3, 2026
@miaulalala miaulalala force-pushed the test/noid/user-ldap-large-annotation branch from 3cdeb01 to ad781be Compare June 3, 2026 08:50
@miaulalala miaulalala dismissed stale reviews from provokateurin and come-nc June 3, 2026 08:51

Code changes

Oracle's OCI8 driver binds each named parameter individually via
OCIBindByName, making queries with 65 000 parameters dramatically
slower than on MySQL or PostgreSQL — slow enough to time out in CI
and degrade production LDAP syncs on large installations.

Lower maxSlices to 5 for Oracle (5 000 params/query) via a match
expression alongside the existing SQLite special-case. SQLite and
all other databases are unchanged.

Assisted-by: ClaudeCode:claude-sonnet-4-6
Signed-off-by: Anna Larch <anna@nextcloud.com>
@miaulalala miaulalala force-pushed the test/noid/user-ldap-large-annotation branch from ad781be to 2faf837 Compare June 3, 2026 08:52
@miaulalala miaulalala added performance 🚀 and removed tests Related to tests labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants