Hi John,
Thank you for quick response and it helped me to understand what is
happening there.
I have another issue with running a COUNT query using Java Native
Interface that FastBit has provided.
If I run "FastBit.QueryHandle handle =
fastBit.build_query("count(miles)", "truck_mileage_index",
"miles>15000");"
The following method returns a value(247) as the result set size which
is greater than 1.
int cnt = fastBit.get_result_size(handle);
For "FastBit.QueryHandle handle = fastBit.build_query("miles",
"truck_mileage_index", "miles>15000");" also it gives 247.
Shouldn't that 'result size' be 1 and its value is 247 for the
COUNT(miles) while 'result size' is 247 for the second query.
Though I run "FastBit.QueryHandle handle =
fastBit.build_query("miles", "truck_mileage_index", "miles>15000");",
It gives the values of column "gas" from the following method.
long[] c = fastBit.get_qualified_longs(handle,"gas");
Shouldn't that query's result set consists only with the qualified
'miles' column? How does it give the qualified 'gas' values when I
have not include the gas column anywhere in the query ? Does it
return all columns in the table which satisfy where clause as the
result set ?
Therefore I feel like the method "fastbit.build_query" does not
consider the select clause I provide and it takes a default value. It
would be great if you can explain me those.
Thanks,
Sasini
On 16 January 2017 at 23:42, John Wu <[email protected]> wrote:
> Dear Sasini,
>
> Thanks for your interest in our work.
>
> The implementation of "COUNT(miles)" does read the values of miles. If
> you want to avoid this use "COUNT(*)".
>
> In terms of execution time, I would expect the three versions to go
> from fast to slow as follows:
> (1) "SELECT COUNT(*) WHERE gas>1500"
> (2) "SELECT miles WHERE gas>1500"
> (3) "SELECT COUNT(miles) WHERE gas>1500"
>
> Here is a caveat, if the variable miles contains NULL values,
> COUNT(miles) will skip those NULL values, while "COUNT(*)" would have
> no way of knowing about the NULL values and couldn't skip them.
>
> John
> _______________________________________________
> FastBit-users mailing list
> [email protected]
> https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users
_______________________________________________
FastBit-users mailing list
[email protected]
https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users