There is fdb_transaction_get_estimated_range_size_bytes which will use the histograms to give you an estimate. If you want to have something precise I am afraid that you have the query the whole range (or materialize this by doing your own book keeping).