# Sync of ESQL queries in canvas, to run at the same time

**URL:** <https://discuss.elastic.co/t/sync-of-esql-queries-in-canvas-to-run-at-the-same-time/253373>\
**Category:** Kibana\
**Tags:** canvas\
**Created:** [October 27, 2020, 12:33am UTC](https://discuss.elastic.co/t/sync-of-esql-queries-in-canvas-to-run-at-the-same-time/253373 "2020-10-27T00:33:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)\
**Post date:** [October 27, 2020, 12:33am UTC](https://discuss.elastic.co/t/sync-of-esql-queries-in-canvas-to-run-at-the-same-time/253373/1 "2020-10-27T00:33:23Z")

</div>

Hello,  
I would like to understand the execution process of ESQL queries in canvas.  
The scenario is that I have 3 queries of simple counts.

ONE

```auto
SELCET COUNT(*) FROM MYINDEX
WHERE FIELD=x

```

TWO

```auto
SELCET COUNT(*) FROM MYINDEX
WHERE FIELD=y

```

THREE

```auto
SELCET COUNT(*) FROM MYINDEX
WHERE FIELD=x or FIELD=y

```

The expected result is 3 counters. x, y and x+y.  
However, I see that the third query does not equal the 2 first queries.  
i.e results of ONE + TWO \<\> THREE  
My assumption is that the queries do not run at the same time, hence the results are different.

1. How do the queries execute in canvas?
2. Is it possible to sync the queries so they will be executed at the same time?

Thank you!

---

<div class="post-metadata">

**Author:** ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)\
**Post date:** [October 29, 2020, 10:01pm UTC](https://discuss.elastic.co/t/sync-of-esql-queries-in-canvas-to-run-at-the-same-time/253373/2 "2020-10-29T22:01:58Z")

</div>

You could get the count where field=x and where field=y something like this;

`SELECT FIELD, count(FIELD) FROM "your index*" group by FIELD`

And then I'm pretty sure the expression editor could give you a total. I'll try to figure that out

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 26, 2020, 10:01pm UTC](https://discuss.elastic.co/t/sync-of-esql-queries-in-canvas-to-run-at-the-same-time/253373/3 "2020-11-26T22:01:58Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
