Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Managed Service for YDB
  • Getting started
  • Access management
    • Overview
      • Pricing policy for serverless mode
      • Request cost for YQL
      • Request cost for the Document API
      • Request cost for special APIs
      • Cost of topic operations
    • Dedicated mode
  • Monitoring metrics
  • Audit Trails events
  • FAQ
  • Public materials

In this article:

  • ReadTable
  • BulkUpsert
  • Building a secondary or vector index
  • Building a secondary index
  • Building a vector index
  1. Pricing policy
  2. Serverless mode
  3. Request cost for special APIs

Rules for estimating the cost of queries to YDB via ad-hoc APIs

Written by
Yandex Cloud
Updated at August 4, 2025
  • ReadTable
  • BulkUpsert
  • Building a secondary or vector index
    • Building a secondary index
    • Building a vector index

ReadTableReadTable

The ReadTable operation allows you to efficiently read large ranges of data from a table. The request cost only depends on the amount of data read based on the rate of 128 RU per 1 MB. For the purpose of cost calculation, the amount is rounded up to a multiple of 1 MB.

BulkUpsertBulkUpsert

BulkUpsert allows you to efficiently upload data to your database. The cost of writing a row using the BulkUpsert operation is 0.5 RU per 1 KB of written data. For the purpose of cost calculation, the data amount is rounded up to a multiple of 1 KB. 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.

Cost calculation example

For example, as part of the BulkUpsert operation, you write four data rows of 2,500 bytes, 100 bytes, 1,200 bytes, and 1,024 bytes.

The cost of this operation is:

0.5 RU × 3 + 0.5 RU × 1 + 0.5 RU × 2 + 0.5 RU × 1 = 3.5 RU

Total, rounded up to the nearest integer: 4 RU

Where:

  • 0.5 is the cost in request units per 1 KB of written data.
  • 3 is the rounded up size of the first row in KB (2,500 bytes = 1,024 bytes + 1,024 bytes + 452 bytes).
  • 1 is the rounded up size of the second row in KB.
  • 2 is the rounded up size of the third row in KB (1,200 bytes = 1,024 bytes + 176 bytes).
  • 1 is the size of the fourth row in KB.

Building a secondary or vector indexBuilding a secondary or vector index

The cost of building an index is made up of the total cost of the following operations:

  • I/O operations whose cost is comprised of:
    • Reading data from indexed and intermediate tables: ReadTable.
    • Writing data to indexed and intermediate tables: BulkUpsert.
  • For vector indexes, the consumption of CPU computing resources is charged separately.

The index building process can be canceled by the user, in which case the cost will be based on actual processed data volume and resources consumed up to the cancellation.

Building a secondary indexBuilding a secondary index

For a secondary index, the cost is calculated as the sum of charges for read operations from the indexed table and write operations to the index table.

Building a vector indexBuilding a vector index

For a vector index, its building nuances and increased consumption of computing resources are additional factors to consider.

For the vector_kmeans_tree type of vector index:

  • The total amount of read data is approximately $5 * ${levels} of the indexed table size (levels is the number of index tree levels).
  • The total amount of written data is approximately $${levels} of the indexed table size.
  • Computing resource consumption includes all CPU usage time during all index building stages.

The final cost is determined as follows: you calculate the sum of data read/write (IO) operation costs and, separately, the CPU consumption cost, and then take the maximum one of these two values as the final cost of building the index.

Was the article helpful?

Previous
Request cost for the Document API
Next
Cost of topic operations
© 2025 Direct Cursus Technology L.L.C.