Creating a YDB connection

Note

To write subqueries in datasets and queries in QL charts, use YQL syntax.

To create a YDB connection:

  1. Go to the workbook page or create a new one.

  2. In the top-right corner, click CreateConnection.

  3. Select a YDB connection.

  4. Select the authentication type:

    • Hostname. Specify the path to the YDB host.
    • Port. Specify the YDB connection port. The default port is 2135.
    • Path to database. Specify the name of the database to connect to.
    • Hostname. Specify the path to the YDB host.

    • Port. Specify the YDB connection port. The default port is 2135.

    • Path to database. Specify the name of the database to connect to.

    • Username. Specify the username for the ClickHouse® connection.

      Warning

      The user must have the readonly parameter set to one of the following values:

      • 0: Allows all requests.

      • 1: Allows only data read requests. In this case, specify the following in the ClickHouse® settings:

        • join_use_nulls = 1
        • send_progress_in_http_headers = 0
        • output_format_json_quote_denormals = 1

        For DataLens, set the Readonly parameter to 1 in the connection's advanced settings.

      • 2: Allows requests to read data and edit settings.

    • Password. Enter the password for the user.

    • OAuth token. Specify an OAuth token to use with YDB.
    • Hostname. Specify the path to the YDB host.
    • Port. Specify the YDB connection port. The default port is 2135.
    • Path to database. Specify the name of the database to connect to.
    • Cache TTL in seconds. Specify the cache time-to-live or leave the default value. The recommended value is 300 seconds (5 minutes).
    • Raw SQL level. Enables you to use an ad-hoc SQL query to generate a dataset.
  5. Click Create connection.

  6. Enter a name for the connection and click Create.

RESOURCE_EXHAUSTED error

If the Managed Service for YDB quotas and limits are exceeded, you may get the RESOURCE_EXHAUSTED error message. To avoid the error, follow these recommendations:

  • Reduce the query rate. To achieve this, you can use filters or specify only the required chart fields to limit the amount of data you get.
  • Follow the recommendations for query optimization.
  • Use the DataLens chart inspector to assess the data amount and upload time.
  • Refer to the Managed Service for YDB monitoring charts to see of the quotas and limits are exceeded. If you need to, you may slightly increase the request unit (RU) limit under Limits.