Hi,
I see huge difference in the performance when running the same query in the different approach.
SQL:
GET _sql?format=json
{
"query": """
SELECT * FROM "baseelements"
WHERE "sessionId" = '621786a4186dc944ccb0729b' AND "streamName" = 'rwr' AND "source" = 'FW'
ORDER BY "_instance"
"""
}
performed in 4560 ms.
DSL:
GET baseelements/_search
{
"query": {
"bool": {
"must": [
{ "match": { "sessionId" : "621786a4186dc944ccb0729b" }},
{"match": { "streamName.keyword": "rwr"}},
{"match": { "source": "FW"}
}
]
}
}
, "sort": [
{
"_instance": {
"order": "asc"
}
}
]
}
Performed in 250 ms.
Why do I see this huge difference?
Thanks,
Avner