Details
Description
Large difference is observed between the estimated and actual cardinality of a query.
Steps to reproduce -
- Create a 3 node cluster with 1 KV and 2 CBAS node.
- Load travel-sample bucket on KV.
- On analytics workbench, datasets and views gets loaded for travel-sample.inventory dataverse.
- create sample on all the datasets under travel-sample.inventory dataverse by running analyze analytics collection command.
- Now run Explain on the following cbas query -
-
select count(*) from (select ar.airportname, al.name as airlinename, ht.name as hotelname, ld.name as landmark from `travel-sample`.inventory.airport ar, `travel-sample`.inventory.airline al, `travel-sample`.inventory.hotel ht, `travel-sample`.inventory.landmark ld where ar.country = al.country and ar.city = ht.city and ht.city = ld.city) as x;
- estimated cardinality is shown as 9646.85
- Now execute the same query.
- The actual result of the query is 46479587