Commit 66540a2
committed
measure(profiler): decode/removal/parse split for DELETE - removal 59%, parse 19%, decode 11%
Items 1 and 2 of the agreed sequence, and item 1's diagnosis inverted by the measurement it required.
Item 2 - two new stages (Parse, IndexDecode) plus the remaining stamps:
- Parse around the batch dispatcher's statement classification: statement parsing is ~1.4us per statement and
was invisible, which is why a stage report could look complete while a fifth to a half of the wall time
sat in the dispatcher. Also stamped the batch commit (Commit).
- IndexDecode, split out of IndexMaintenance, because "is it the decode or the removal?" decides the fix.
- IndexMaintenance around the bulk-update path's per-row hash-index Remove/Add.
- still uncovered and recorded in the plan: the second batch dispatcher, parser internals, and
WalAppend/WalFlush (stages that exist but nothing writes).
Item 1 - DELETE attributed with the new split (10K by PK, 50K rows, one batch transaction):
TEXT-indexed, plaintext 97,528 ops/s 10.25 us/row
TEXT-indexed, at-rest 91,917 ops/s 10.88 us/row
INT-indexed, plaintext 193,001 ops/s 5.18 us/row
INT-indexed, at-rest 154,004 ops/s 6.49 us/row
stages (at-rest): index-maint 58.6% (42.2 ms in SEVEN calls: PK DeleteBulk + one RemoveBatchKeys per loaded
index) | parse 19.3% (13.9 ms in 10,000 calls) | index-decode 11.3% | row-locate 7.1% | commit 2.6% |
engine-write 1.2%.
The decode hypothesis (arena reads to build hash keys) is WRONG: decode is 11%. The cost is the REMOVAL, and a
TEXT key costs ~3x an INTEGER key there (42.2 vs 14.4 ms) - string hashing/equality on the key. The tombstone
is noise for the third time. And SQL parsing turned out to be 19-45% of a DELETE batch: the same per-statement
cost the harness pays for every row of its UPDATE/DELETE phases, which makes a prepared/canonical DELETE path
the more promising of the two remaining levers.
Gate: SharpCoreDB.slnx 0 errors; SharpCoreDB.Tests 1857 / 0 failed / 16 skipped. One full-suite run showed a
single failure in HashIndexPerformanceTests (a timing-ratio test) which passes 2/2 in isolation - recorded as a
flake, not a regression.
Docs: plan section 7 (the split, the findings, and the honest instrumentation-coverage list).1 parent b98f241 commit 66540a2
4 files changed
Lines changed: 73 additions & 10 deletions
File tree
- docs/performance
- src/SharpCoreDB
- DataStructures
- Database/Execution
- Diagnostics
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1095 | 1095 | | |
1096 | 1096 | | |
1097 | 1097 | | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
1102 | | - | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
1103 | 1127 | | |
1104 | 1128 | | |
1105 | 1129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2209 | 2209 | | |
2210 | 2210 | | |
2211 | 2211 | | |
| 2212 | + | |
2212 | 2213 | | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
2213 | 2217 | | |
2214 | 2218 | | |
| 2219 | + | |
2215 | 2220 | | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
2216 | 2224 | | |
2217 | 2225 | | |
2218 | 2226 | | |
| |||
4074 | 4082 | | |
4075 | 4083 | | |
4076 | 4084 | | |
4077 | | - | |
| 4085 | + | |
4078 | 4086 | | |
| 4087 | + | |
4079 | 4088 | | |
4080 | 4089 | | |
4081 | 4090 | | |
| |||
4097 | 4106 | | |
4098 | 4107 | | |
4099 | 4108 | | |
| 4109 | + | |
| 4110 | + | |
| 4111 | + | |
| 4112 | + | |
4100 | 4113 | | |
4101 | 4114 | | |
4102 | 4115 | | |
| |||
4119 | 4132 | | |
4120 | 4133 | | |
4121 | 4134 | | |
| 4135 | + | |
| 4136 | + | |
| 4137 | + | |
4122 | 4138 | | |
| 4139 | + | |
4123 | 4140 | | |
4124 | 4141 | | |
4125 | | - | |
4126 | | - | |
4127 | 4142 | | |
4128 | 4143 | | |
4129 | 4144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1021 | 1021 | | |
1022 | 1022 | | |
1023 | 1023 | | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
1024 | 1029 | | |
1025 | 1030 | | |
1026 | 1031 | | |
| |||
1064 | 1069 | | |
1065 | 1070 | | |
1066 | 1071 | | |
| 1072 | + | |
| 1073 | + | |
1067 | 1074 | | |
1068 | 1075 | | |
1069 | 1076 | | |
| |||
1175 | 1182 | | |
1176 | 1183 | | |
1177 | 1184 | | |
| 1185 | + | |
1178 | 1186 | | |
1179 | 1187 | | |
| 1188 | + | |
1180 | 1189 | | |
1181 | 1190 | | |
1182 | 1191 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
60 | 75 | | |
61 | 76 | | |
62 | | - | |
| 77 | + | |
63 | 78 | | |
64 | 79 | | |
65 | 80 | | |
66 | 81 | | |
67 | 82 | | |
68 | 83 | | |
69 | | - | |
| 84 | + | |
70 | 85 | | |
71 | 86 | | |
72 | 87 | | |
| |||
0 commit comments