Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • 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
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Managed Service for YDB
  • Getting started
  • Access management
    • Overview
      • Serverless mode pricing policy
      • Query cost for YQL
      • Query cost for the Document API
      • Query cost for special APIs
      • Cost of topic operations
  • Monitoring metrics
  • Audit Trails events
  • FAQ
  • Public materials
  1. Pricing policy
  2. Serverless mode
  3. Query cost for YQL

Estimating the cost of YQL queries to YDB

Written by
Yandex Cloud
Updated at April 24, 2026

To run YQL queries, the system uses server-side resources. To view the information about consumed resources, see the relevant query statistics.

To evaluate the YDB API request cost, you need to calculate the CPU and I/O cost, out of which the largest value is the final one.

  • CPU cost:

    The CPU time spent to compile the request is added to the CPU time spent at each step of request execution. This value is then divided by the CPU time increment of 1.5 ms, rounded down, and converted to RUs based on the pricing plan from the table below.

    Cached requests are not recompiled. For caching, use bind variables in your requests and enable caching of the request execution plan.

  • I/O cost:

    The following values are calculated:

    • Number of disk reads: The number of read records and data blocks is compared, and the largest of them is taken. The number of blocks is calculated by dividing the amount of bytes read by the block size of 4 KB and rounding up the value.
    • Number of disk writes: The number of written records and data blocks is compared, and the largest of them is taken. The number of blocks is calculated by dividing the amount of bytes written by the block size of 1 KB and rounding up the value.

    This includes I/O operations in tables and indexes. Record deletes are charged based on their number.

    The number of reads and writes is converted to RUs based on the pricing plan from the table below with the resulting costs summed up.

Warning

Some record conversions involve data reads or deletes before updating, and this may affect the request cost.

Unit costs in RUs:

Value to estimate Cost
One CPU time increment 1 RU
One read 1 RU
One write 2 RUs

The following operations are not charged:

  • Creating, updating, and deleting table schemas.
  • Getting a description and list of tables.
  • Creating and deleting directories.
Example of request cost calculation

Request statistics:

query_phases {
  ...
  table_access {
    ...
    reads {
      rows: 2
      bytes: 16
    }
    ...
  }
  cpu_time_us: 475
  ...
}
query_phases {
  ...
  table_access {
    ...
    updates {
      rows: 2
      bytes: 2456
    }
    ...
  }
  cpu_time_us: 514
  ...
}
compilation {
  ...
  cpu_time_us: 4062
}
process_cpu_time_us: 870

Where:

  • query_phases[].cpu_time_us: CPU time spent on executing the request, in microseconds.
  • compilation.cpu_time_us: CPU time spent on compiling the request, in microseconds.
  • process_cpu_time_us: CPU time spent on managing interaction, in microseconds.
  • query_phases[].reads.rows: Number of read data records.
  • query_phases[].reads.bytes: Number of read data bytes.
  • query_phases[].updates.rows: Number of written data records.
  • query_phases[].updates.bytes: Number of written data bytes.

To estimate the CPU cost, the request's total CPU time is divided by 1.5 ms, ( 475 + 514 + 4062 + 870 ) / 1500 = 3.95. The result is rounded down and converted to RUs:

3 × 1 RU = 3 RUs

To estimate the I/O cost:

  • The number of disk reads is calculated in records and blocks, and the largest of them is taken:

    • Two rows read, the number of operations is 2.
    • 16 bytes read, 16 / ( 4 × 1024 ) = 0.004, the result is rounded up, the number of operations is 1.

    The number of read operations is 2.

  • The number of disk writes in calculated in records and blocks, and the largest of them is taken:

    • Two records written, the number of operations is 2.
    • 2,456 bytes written, 2456 / 1024 = 2.398, the result is rounded up, the number of operations is 3.

    The number of write operations is 3.

I/O cost:

2 × 1 RU + 3 × 2 RUs = 8 RUs

The request cost is 8 RUs.

Was the article helpful?

Previous
Serverless mode pricing policy
Next
Query cost for the Document API
© 2026 Direct Cursus Technology L.L.C.