File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -40,14 +40,25 @@ TString TBillingStats::ToString() const {
40
40
}
41
41
42
42
ui64 TRUCalculator::ReadTable (ui64 bytes) {
43
+ // The ReadTable operation lets you efficiently read large ranges of data from a table.
44
+ // The request cost only depends on the amount of data read based on the rate of 128 RU per 1 MB.
45
+ // When calculating the cost, the amount is rounded up to a multiple of 1 MB.
46
+ // https://yandex.cloud/en-ru/docs/ydb/pricing/ru-special#readtable
43
47
return 128 * ((bytes + 1_MB - 1 ) / 1_MB);
44
48
}
45
49
46
50
ui64 TRUCalculator::BulkUpsert (ui64 bytes, ui64 rows) {
51
+ // BulkUpsert lets you efficiently upload data to the database.
52
+ // The cost of writing a row using the BulkUpsert operation is 0.5 RU per 1 KB of written data.
53
+ // When calculating the cost, the data amount is rounded up to a multiple of 1 KB.
54
+ // The total cost of the operation is calculated as the sum of costs for all rows written, with the result rounded up to the nearest integer.
55
+ // https://yandex.cloud/en-ru/docs/ydb/pricing/ru-special#bulkupsert
47
56
return (Max (rows, (bytes + 1_KB - 1 ) / 1_KB) + 1 ) / 2 ;
48
57
}
49
58
50
59
ui64 TRUCalculator::Calculate (const TBillingStats& stats) {
60
+ // The cost of building an index is the sum of the cost of ReadTable from the source table and BulkUpsert to the index table.
61
+ // https://yandex.cloud/en-ru/docs/ydb/pricing/ru-special#secondary-index
51
62
return TRUCalculator::ReadTable (stats.GetReadBytes ())
52
63
+ TRUCalculator::BulkUpsert (stats.GetUploadBytes (), stats.GetUploadRows ());
53
64
}
Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ class TBillingStats {
52
52
};
53
53
54
54
struct TRUCalculator {
55
- // https://a.yandex-team.ru/arc/trunk/arcadia/kikimr/docs/ru/pricing/serverless.md
56
55
static ui64 ReadTable (ui64 bytes);
57
56
static ui64 BulkUpsert (ui64 bytes, ui64 rows);
58
57
static ui64 Calculate (const TBillingStats& stats);
You can’t perform that action at this time.
0 commit comments