Commit e797d39
Merged PR 1766738: [Perf] Reduce CPU cycles for UpdateOneInternal.
### Does this PR have any customer impact?
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
### Are you introducing any new config? If yes, do you have tests with and without them being set?
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Save Some Cpu Cycle In UpdateOne CodePath by not coverting pgbson to bson value, let's use existing one.

----
#### AI description (iteration 1)
#### PR Classification
Performance optimization in the update code path.
#### PR Summary
This PR refines the update process by eliminating an early and redundant BSON conversion for query extraction, thereby reducing CPU cycles. It replaces the call to get the object ID filter with a more direct approach while still initializing the BSON query later when needed.
- `oss/pg_documentdb/src/commands/update.c`: Removed the premature `PgbsonInitFromDocumentBsonValue` call and replaced `GetObjectIdFilterFromQueryDocument` with `GetObjectIdFilterFromQueryDocumentValue`, using `updateOneParams->query` directly.
- `oss/pg_documentdb/src/commands/update.c`: Reintroduced BSON query initialization later in the function for proper argument type handling.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->1 parent 6b95258 commit e797d39
1 file changed
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3249 | 3249 | | |
3250 | 3250 | | |
3251 | 3251 | | |
3252 | | - | |
| 3252 | + | |
3253 | 3253 | | |
3254 | 3254 | | |
3255 | | - | |
3256 | | - | |
3257 | | - | |
3258 | | - | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
3259 | 3259 | | |
3260 | 3260 | | |
3261 | 3261 | | |
| |||
3348 | 3348 | | |
3349 | 3349 | | |
3350 | 3350 | | |
| 3351 | + | |
3351 | 3352 | | |
3352 | 3353 | | |
3353 | 3354 | | |
| |||
0 commit comments