Skip to content

Commit 6143505

Browse files
committed
DPL Analysis: query the CCDB once per run of equal timestamps
When a CCDB table has no separate uniformity column, the analysis CCDB fetcher called populateCacheWith for every row of the source table, so about 19k times per timeframe for a BC-indexed table such as the ones of propagation-service-v2, even though consecutive BCs share the same millisecond timestamp. Reuse the previous responses whenever the lookup key, the uniformity value or else the timestamp, is the same as the one of the previous row. Since the key determines every FetchOp of the row, the responses and hence the output table are unchanged. For the LHC25b4a6 AO2D of Hyperloop test 799098 this is about 350 runs of equal (millisecond) BC times over 1.17M BCs in 61 DFs, instead of one query per BC.
1 parent 3dda7ea commit 6143505

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

‎Framework/CCDBSupport/src/AnalysisCCDBHelpers.cxx‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ AlgorithmSpec AnalysisCCDBHelpers::fetchFromCCDB(ConfigContext const& /*ctx*/)
235235

236236
// Rows sharing a uniformity value resolve to the same objects, so the query is
237237
// issued once per distinct value and the resulting handles are repeated for the
238-
// rest of the run. When uniformity is the timestamp itself (the default) this
239-
// degenerates to the previous behaviour, one query per row.
238+
// rest of the run. When uniformity is the timestamp itself (the default) the
239+
// query is issued once per run of consecutive rows with the same timestamp.
240240
std::vector<int64_t> uniformity;
241241
bool const shortCircuit = uniformityColumn.get() != timestampColumn.get();
242242
if (shortCircuit) {
@@ -273,15 +273,13 @@ AlgorithmSpec AnalysisCCDBHelpers::fetchFromCCDB(ConfigContext const& /*ctx*/)
273273

274274
for (int64_t ri = 0; ri < chunk->data()->length; ri++) {
275275
++row;
276-
bool const sameAsPrevious = shortCircuit && haveResponses && uniformity[row] == previousUniformity;
277-
if (shortCircuit) {
278-
previousUniformity = uniformity[row];
279-
}
280276
ops.clear();
281277
int64_t timestamp = timestamps[ri];
282278
// Key the path lookup on the uniformity value; when uniformity is the
283279
// timestamp itself the mapping expresses validity intervals instead.
284280
int64_t const uniformityKey = shortCircuit ? uniformity[row] : timestamp;
281+
bool const sameAsPrevious = haveResponses && uniformityKey == previousUniformity;
282+
previousUniformity = uniformityKey;
285283
int fi = 0;
286284
for (auto& field : schema->fields()) {
287285
auto const& url = pathTables[i][fi++].resolve(uniformityKey, field->name());

0 commit comments

Comments
 (0)