@@ -225,27 +225,11 @@ bool TimestampOrderingTransactionManager::PerformRead(
225
225
226
226
// if we have already owned the version.
227
227
PELOTON_ASSERT (IsOwner (current_txn, tile_group_header, tuple_id) == true );
228
-
229
- // Increment table read op stats
230
- if (static_cast <StatsType>(settings::SettingsManager::GetInt (
231
- settings::SettingId::stats_mode)) != StatsType::INVALID) {
232
- stats::BackendStatsContext::GetInstance ()->IncrementTableReads (
233
- location.block );
234
- }
235
-
236
228
return true ;
237
229
238
230
} else {
239
231
// if it's not select for update, then update read set and return true.
240
-
241
232
current_txn->RecordRead (location);
242
-
243
- // Increment table read op stats
244
- if (static_cast <StatsType>(settings::SettingsManager::GetInt (
245
- settings::SettingId::stats_mode)) != StatsType::INVALID) {
246
- stats::BackendStatsContext::GetInstance ()->IncrementTableReads (
247
- location.block );
248
- }
249
233
return true ;
250
234
}
251
235
@@ -283,26 +267,13 @@ bool TimestampOrderingTransactionManager::PerformRead(
283
267
}
284
268
// if we have already owned the version.
285
269
PELOTON_ASSERT (IsOwner (current_txn, tile_group_header, tuple_id) == true );
286
- // Increment table read op stats
287
- if (static_cast <StatsType>(settings::SettingsManager::GetInt (
288
- settings::SettingId::stats_mode)) != StatsType::INVALID) {
289
- stats::BackendStatsContext::GetInstance ()->IncrementTableReads (
290
- location.block );
291
- }
292
270
return true ;
293
271
294
272
} else {
295
273
// a transaction can never read an uncommitted version.
296
274
if (IsOwner (current_txn, tile_group_header, tuple_id) == false ) {
297
275
if (IsOwned (current_txn, tile_group_header, tuple_id) == false ) {
298
276
current_txn->RecordRead (location);
299
-
300
- // Increment table read op stats
301
- if (static_cast <StatsType>(settings::SettingsManager::GetInt (
302
- settings::SettingId::stats_mode)) != StatsType::INVALID) {
303
- stats::BackendStatsContext::GetInstance ()->IncrementTableReads (
304
- location.block );
305
- }
306
277
return true ;
307
278
308
279
} else {
@@ -315,14 +286,6 @@ bool TimestampOrderingTransactionManager::PerformRead(
315
286
} else {
316
287
// this version must already be in the read/write set.
317
288
// so no need to update read set.
318
- // current_txn->RecordRead(location);
319
-
320
- // Increment table read op stats
321
- if (static_cast <StatsType>(settings::SettingsManager::GetInt (
322
- settings::SettingId::stats_mode)) != StatsType::INVALID) {
323
- stats::BackendStatsContext::GetInstance ()->IncrementTableReads (
324
- location.block );
325
- }
326
289
return true ;
327
290
}
328
291
}
@@ -379,12 +342,6 @@ bool TimestampOrderingTransactionManager::PerformRead(
379
342
PELOTON_ASSERT (GetLastReaderCommitId (tile_group_header, tuple_id) ==
380
343
current_txn->GetCommitId () ||
381
344
GetLastReaderCommitId (tile_group_header, tuple_id) == 0 );
382
- // Increment table read op stats
383
- if (static_cast <StatsType>(settings::SettingsManager::GetInt (
384
- settings::SettingId::stats_mode)) != StatsType::INVALID) {
385
- stats::BackendStatsContext::GetInstance ()->IncrementTableReads (
386
- location.block );
387
- }
388
345
return true ;
389
346
390
347
} else {
@@ -395,13 +352,6 @@ bool TimestampOrderingTransactionManager::PerformRead(
395
352
current_txn->GetCommitId (), false ) == true ) {
396
353
// update read set.
397
354
current_txn->RecordRead (location);
398
-
399
- // Increment table read op stats
400
- if (static_cast <StatsType>(settings::SettingsManager::GetInt (
401
- settings::SettingId::stats_mode)) != StatsType::INVALID) {
402
- stats::BackendStatsContext::GetInstance ()->IncrementTableReads (
403
- location.block );
404
- }
405
355
return true ;
406
356
} else {
407
357
// if the tuple has been owned by some concurrent transactions,
@@ -419,14 +369,6 @@ bool TimestampOrderingTransactionManager::PerformRead(
419
369
420
370
// this version must already be in the read/write set.
421
371
// so no need to update read set.
422
- // current_txn->RecordRead(location);
423
-
424
- // Increment table read op stats
425
- if (static_cast <StatsType>(settings::SettingsManager::GetInt (
426
- settings::SettingId::stats_mode)) != StatsType::INVALID) {
427
- stats::BackendStatsContext::GetInstance ()->IncrementTableReads (
428
- location.block );
429
- }
430
372
return true ;
431
373
}
432
374
}
@@ -464,13 +406,6 @@ void TimestampOrderingTransactionManager::PerformInsert(
464
406
465
407
// Write down the head pointer's address in tile group header
466
408
tile_group_header->SetIndirection (tuple_id, index_entry_ptr);
467
-
468
- // Increment table insert op stats
469
- if (static_cast <StatsType>(settings::SettingsManager::GetInt (
470
- settings::SettingId::stats_mode)) != StatsType::INVALID) {
471
- stats::BackendStatsContext::GetInstance ()->IncrementTableInserts (
472
- location.block );
473
- }
474
409
}
475
410
476
411
void TimestampOrderingTransactionManager::PerformUpdate (
@@ -548,13 +483,6 @@ void TimestampOrderingTransactionManager::PerformUpdate(
548
483
549
484
// Add the old tuple into the update set
550
485
current_txn->RecordUpdate (old_location);
551
-
552
- // Increment table update op stats
553
- if (static_cast <StatsType>(settings::SettingsManager::GetInt (
554
- settings::SettingId::stats_mode)) != StatsType::INVALID) {
555
- stats::BackendStatsContext::GetInstance ()->IncrementTableUpdates (
556
- new_location.block );
557
- }
558
486
}
559
487
560
488
void TimestampOrderingTransactionManager::PerformUpdate (
@@ -581,13 +509,6 @@ void TimestampOrderingTransactionManager::PerformUpdate(
581
509
// transaction
582
510
// is updating a version that is installed by itself.
583
511
// in this case, nothing needs to be performed.
584
-
585
- // Increment table update op stats
586
- if (static_cast <StatsType>(settings::SettingsManager::GetInt (
587
- settings::SettingId::stats_mode)) != StatsType::INVALID) {
588
- stats::BackendStatsContext::GetInstance ()->IncrementTableUpdates (
589
- location.block );
590
- }
591
512
}
592
513
593
514
void TimestampOrderingTransactionManager::PerformDelete (
@@ -669,13 +590,6 @@ void TimestampOrderingTransactionManager::PerformDelete(
669
590
}
670
591
671
592
current_txn->RecordDelete (old_location);
672
-
673
- // Increment table delete op stats
674
- if (static_cast <StatsType>(settings::SettingsManager::GetInt (
675
- settings::SettingId::stats_mode)) != StatsType::INVALID) {
676
- stats::BackendStatsContext::GetInstance ()->IncrementTableDeletes (
677
- old_location.block );
678
- }
679
593
}
680
594
681
595
void TimestampOrderingTransactionManager::PerformDelete (
@@ -703,13 +617,6 @@ void TimestampOrderingTransactionManager::PerformDelete(
703
617
// if this version is newly inserted.
704
618
current_txn->RecordDelete (location);
705
619
}
706
-
707
- // Increment table delete op stats
708
- if (static_cast <StatsType>(settings::SettingsManager::GetInt (
709
- settings::SettingId::stats_mode)) != StatsType::INVALID) {
710
- stats::BackendStatsContext::GetInstance ()->IncrementTableDeletes (
711
- location.block );
712
- }
713
620
}
714
621
715
622
ResultType TimestampOrderingTransactionManager::CommitTransaction (
@@ -752,20 +659,6 @@ ResultType TimestampOrderingTransactionManager::CommitTransaction(
752
659
gc_object_set->emplace_back (database_oid, table_oid, index_oid);
753
660
}
754
661
755
- oid_t database_id = 0 ;
756
- if (static_cast <StatsType>(settings::SettingsManager::GetInt (
757
- settings::SettingId::stats_mode)) != StatsType::INVALID) {
758
- for (const auto &tuple_entry : rw_set) {
759
- // Call the GetConstIterator() function to explicitly lock the cuckoohash
760
- // and initilaize the iterator
761
- const auto tile_group_id = tuple_entry.first .block ;
762
- database_id = manager.GetTileGroup (tile_group_id)->GetDatabaseId ();
763
- if (database_id != CATALOG_DATABASE_OID) {
764
- break ;
765
- }
766
- }
767
- }
768
-
769
662
// install everything.
770
663
// 1. install a new version for update operations;
771
664
// 2. install an empty version for delete operations;
@@ -896,13 +789,6 @@ ResultType TimestampOrderingTransactionManager::CommitTransaction(
896
789
897
790
EndTransaction (current_txn);
898
791
899
- // Increment # txns committed metric
900
- if (static_cast <StatsType>(settings::SettingsManager::GetInt (
901
- settings::SettingId::stats_mode)) != StatsType::INVALID) {
902
- stats::BackendStatsContext::GetInstance ()->IncrementTxnCommitted (
903
- database_id);
904
- }
905
-
906
792
return result;
907
793
}
908
794
@@ -930,20 +816,6 @@ ResultType TimestampOrderingTransactionManager::AbortTransaction(
930
816
gc_object_set->emplace_back (database_oid, table_oid, index_oid);
931
817
}
932
818
933
- oid_t database_id = 0 ;
934
- if (static_cast <StatsType>(settings::SettingsManager::GetInt (
935
- settings::SettingId::stats_mode)) != StatsType::INVALID) {
936
- for (const auto &tuple_entry : rw_set) {
937
- // Call the GetConstIterator() function to explicitly lock the cuckoohash
938
- // and initilaize the iterator
939
- const auto tile_group_id = tuple_entry.first .block ;
940
- database_id = manager.GetTileGroup (tile_group_id)->GetDatabaseId ();
941
- if (database_id != CATALOG_DATABASE_OID) {
942
- break ;
943
- }
944
- }
945
- }
946
-
947
819
// Iterate through each item pointer in the read write set
948
820
// TODO (Pooja): This might be inefficient since we will have to get the
949
821
// tile_group_header for each entry. Check if this needs to be consolidated
@@ -1085,12 +957,6 @@ ResultType TimestampOrderingTransactionManager::AbortTransaction(
1085
957
current_txn->SetResult (ResultType::ABORTED);
1086
958
EndTransaction (current_txn);
1087
959
1088
- // Increment # txns aborted metric
1089
- if (static_cast <StatsType>(settings::SettingsManager::GetInt (
1090
- settings::SettingId::stats_mode)) != StatsType::INVALID) {
1091
- stats::BackendStatsContext::GetInstance ()->IncrementTxnAborted (database_id);
1092
- }
1093
-
1094
960
return ResultType::ABORTED;
1095
961
}
1096
962
0 commit comments