How to debug EntityQuery? I have a query with a 'BETWEEN' operator and I should have some results. Is there any way to show the actual SQL query made ?

Here is my entity query :

    $query = $this-&gt;entity_query-&gt;get('node');
    $query-&gt;condition('type', 'store');
    $query-&gt;condition('status', 1);
    if ($lat_min &amp;&amp; $lng_min &amp;&amp; is_numeric($lat_min) &amp;&amp; is_numeric($lng_min) &amp;&amp; $lat_max &amp;&amp; $lng_max &amp;&amp; is_numeric($lat_max) &amp;&amp; is_numeric($lng_max)) {
      $query-&gt;condition('field_store_geolocation.lat', [$lat_min, $lat_max], 'BETWEEN');
      $query-&gt;condition('field_store_geolocation.lng', [$lng_min, $lng_max], 'BETWEEN');
    }
    $nids = $query-&gt;execute();


Of course I made sure that my values were the one expected and I also tried with '&lt;', '>' and with no vars but actual values to make sure nothing was wrong there.

I'm using the 'Geolocation Field' module here.
If you use devel module a simple approach for debugging entity query could be use the debug tag (simply add $query-&gt;addTag('debug') to your query).
Here an example

$query = $this-&gt;entity_query-&gt;get('node');
$query-&gt;condition('status', NODE_PUBLISHED);
$query-&gt;addTag('debug');
$query-&gt;execute();


And the result