[Yandex Cloud documentation](../../index.md) > [Yandex WebSQL](../index.md) > [Step-by-step guides](index.md) > Working with query history

# Working with query history

Yandex WebSQL features [query history](../concepts/index.md#query-log). You can:
   * [View executed queries](#view-executed-queries).
   * [Rerun a query](#re-run-query).
   * [Publish a query](#publish-query).
   * [Configure access permissions for a published query](#set-access-rights-to-published-query).
   * [Delete a historical query](#remove-query-from-history).

## Viewing an executed query {#view-executed-query}

To view executed queries, go to ![image](../../_assets/console-icons/clock-arrow-rotate-left.svg) **Query history**.

To view a specific query, select it from the history. The selected query will show up in the data panel.

{% note tip %}

To find specific queries:
* Use search by entering the database or table name in the search field.
* Apply filters by clicking **Filter** and selecting a connection, query execution status, and time interval.

{% endnote %}

## Rerunning a query {#re-run-query}

To rerun an executed query:

1. Go to the ![image](../../_assets/console-icons/clock-arrow-rotate-left.svg) **Query history** section.

   {% note tip %}
   
   To find specific queries:
   * Use search by entering the database or table name in the search field.
   * Apply filters by clicking **Filter** and selecting a connection, query execution status, and time interval.
   
   {% endnote %}

1. Select a query: it will show up in the data panel.

1. Click **Open in editor**.

1. Optionally, update the query parameters.

1. Click **Execute**.

You can also [save your query as a template](templates.md).

## Publishing a query {#publish-query}

You can publish your query. Once published, the query will be available to all folder users. You cannot unpublish a query.

To publish a query:

1. Go to the ![image](../../_assets/console-icons/clock-arrow-rotate-left.svg) **Query history** section.

1. Click ![image](../../_assets/console-icons/ellipsis.svg) to the right of the query you need and select **Publish**.

1. In the window that opens, click **Publish**.

You will see ![image](../../_assets/console-icons/lock-open.svg) next to the information about the published query.

## Configuring access permissions for a published query {#set-access-rights-to-published-query}

To configure [access permissions](../security/index.md):

1. Go to the ![image](../../_assets/console-icons/clock-arrow-rotate-left.svg) **Query history** section.

1. Click ![image](../../_assets/console-icons/ellipsis.svg) to the right of the query you need and select **Access permissions**.

1. In the window that opens, click **Assign roles**.

1. Assign the required roles and click **Save**.

## Deleting a historical query {#remove-query-from-history}

1. Go to the ![image](../../_assets/console-icons/clock-arrow-rotate-left.svg) **Query history** section.

1. Click ![image](../../_assets/console-icons/ellipsis.svg) to the right of the query and select **Delete**.

1. In the window that opens, click **Apply**.