Hi,
When I reduce FILTER block, the execution time of the query longs shorter,
but I receive less result than original query. So result set is reducing
too.
I recorded each elapsed time round the while loop, and there is variability
at some looping times. The code that records times:
int i = 0;
long before = System.currentTimeMillis();
while (resultSet.hasNext()) {
i++;
resultSet.next();
long after = System.currentTimeMillis();
fileWriter.append("Time of " + i + ". result: " + (after - before)+" ms"
+ "\n");
before = System.currentTimeMillis();
}
The example output:
Time of 1. result: 4 ms
Time of 2. result: 0 ms
Time of 3. result: 1 ms
...
Time of 20. result: 14 ms
Time of 21. result: 0 ms
Time of 22. result: 1 ms
Time of 23. result: 1 ms
...
Time of 27. result: 17 ms
Time of 28. result: 1 ms
...
Time of 34. result: 10 ms
... and so on.
But when I execute LIMIT query, these times are all 0 or 1.
I don't know that, why in FILTER query, there is time differences at
getting some results. Do you have any idea about that?
Best,
Burak Yönyül
2013/2/28 Andy Seaborne <[email protected]>
> On 28/02/13 12:44, Burak Yönyül wrote:
>
>> Hi Andy,
>>
>> Count query is executed in 20 miliseconds and it returns 71019 as count.
>>
>
> The basic pattern and count does not touch the values of the variables.
> So I'm inclined to think that the filter is the costly part.
>
>
> As I understand you, the query result is calculated when the http
>> request is sent in hasNext(). But, the results are not sent back to me
>> immediatly. The results are sent to me as long as I read them with
>> hasNext(). Am I right?
>>
>
> looks like the server has to go through a lot of the results of the
> pattern matching, testing against the FILTER, between
>
> If you want to explore what's going on,
>
> 1/ use a FILTER that is much shorter (10% of the length, say) and see what
> happens. This will not get you the right results but will yield
> information as to what 4Store might be doing.
>
> Printing the elapsed time at various points is more info.
>
> 2/ QueryExecutionFactory.**sparqlService is recreating the query - that
> might be a little slow.
>
> 3/ The elapsed time each time round the while loop - is it the same amount
> of time each time or is it variable?
>
> Andy
>
>
>> Burak
>>
>
>