kazu2012 / persevere-framework

Automatically exported from code.google.com/p/persevere-framework
0 stars 0 forks source link

inconsistencies w jsonquery & maxIterations #210

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Not sure if this is working as designed or is a defect, but take a look at
the queries below.  When I just query w/wildcards, I get results, but if I
try to apply some type of function/limiter, then I get the maxIterations
failure msg.

/[?City="Austin*"]        <-- delivers thousands of results
/[?City="Austin*"][:5]    <-- instantly fails with maxIterations msg

/[?City="Austin*"][?County="Travis*"]   <--  delivers thousands of results
/[?City="Austin*"][?County="Travis*"].length   <-- fails w/maxIterations msg

Thanks,
Dylan

Original issue reported on code.google.com by dty...@gmail.com on 20 Jun 2009 at 5:49

GoogleCodeExporter commented 8 years ago
The first one will output the results as it is finding matches, thus it should 
fail 
*after* outputting several thousand (it is more efficient to output while 
matching). 
Note the it fails because it is iterating through the table in JavaScript, 
because 
wildcards aren't optimized to go against the index. This is still an 
outstanding 
issue (and of course this will only be supported for ending wildcards).
The second one should work now, I checked in a more efficient implementation of 
slice.
The third one should fail the same way as the first.
The third one fails because it has to execute the query test on every item in 
the 
table, thus going over the maxIterations limit. Note that if you use a Range 
header 
to do pagination, it will return an estimate of the total count, which will not 
cause 
a maxIterations failure.

There is still an outstanding issue of wildcards (ending wildcard) not going to 
the 
index, which would be much more efficient, but that should be in another ticket.

Original comment by kris...@gmail.com on 26 Jun 2009 at 9:08