How to profile whether qlc:q does full table scan, key prefix scan or key lookup?
For instance, ets of type set with entries like {{KeyPrefix, KeySuffix}, Value} - will
qlc:q([
{{KeyPrefix, KeySuffix}, Value} ||
{{KeyPrefix, KeySuffix}, Value} <- ets:table(Table),
KeyPrefix =:= Something
])
do full table scan or key prefix scan?
You can obtain a lot of informations about your QLC expression using qlc:info/1. That may not help you determine whether a given subquery uses a full table scan or whatnot but that does give you back the query plan and the tables related to your query, which you can then pass to ets:info/1 to retrieve their type and keypos.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With