---
schema_version: "1"
id: e4cf06a776a1f59a168328c7d7e19bbcb2e9c04b338ab938848b0995d2427904
title: Retrieve Query Plans
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/webconsole/guides/query-records/retrieve-query-plans.md
canonical_url: https://developer.salesforce.com/docs/platform/webconsole/guide/retrieve-query-plans.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6d14ab0037cda0e2fef1fbfdf5ab130791b6ad08e22a5a8469b1909286910ede
products:
  - Web Console
  - salesforcedx
---
# Retrieve Query Plans

Use the Query Plan tool to view, optimize, and speed up SOQL queries on large datasets.

You can retrieve a query plan for a query by using one of these methods. The query plan shows each operation and its cost. The output panel shows all the available notes for your highest ranked query plan, which is the query plan currently in use.
You can view the query plan from the SOQL Builder and from the text editor. The plan opens in the _Output_ tab.

- Open a query in the SOQL query builder and click **Get Query Plan**.

  ![The query plan shows in the SOQL Query Builder](https://developer.salesforce.com/docs/platform/media/shared/query_plan_tool.png '{"class": "image-lg image-framed"}')

- Open a query in the text editor and click the **Get Query Plan** text preceding the query text.

  ![Get query plan from the text editor](https://developer.salesforce.com/docs/platform/media/shared/query_plan_text2.png '{"class": "image-md image-framed"}')

