# How can i calculate cost of query?

**URL:** <https://discuss.elastic.co/t/how-can-i-calculate-cost-of-query/378995>\
**Category:** Elasticsearch\
**Created:** [June 9, 2025, 9:44am UTC](https://discuss.elastic.co/t/how-can-i-calculate-cost-of-query/378995 "2025-06-09T09:44:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zoree](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zoree/32/142863_2.png) [@Zoree](https://discuss.elastic.co/u/Zoree)\
**Post date:** [June 9, 2025, 9:44am UTC](https://discuss.elastic.co/t/how-can-i-calculate-cost-of-query/378995/1 "2025-06-09T09:44:47Z")

</div>

I want to create a functionality for calculating the cost of a query before it is launched, but I am interested in how to make very different queries. Suppose you think that 1 word = 1, operator "should" = 1,2, "mus"t = 1,15, that is: A or B or C = 3 \* 1,2

---

<div class="post-metadata">

**Author:** ![Tortoise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tortoise/32/147587_2.png) [@Tortoise](https://discuss.elastic.co/u/Tortoise)\
**Post date:** [June 9, 2025, 12:31pm UTC](https://discuss.elastic.co/t/how-can-i-calculate-cost-of-query/378995/2 "2025-06-09T12:31:06Z")

</div>

Hello @Zoree

If possible could you please try to add more details as to what is the expectation?

To get the cost of query in DevTools we do have SearchProfiler where it can share the complete details of the query execution with time.

Thanks!!
