Re: [basex-talk] [XQUERY] Filter and paging with window clause
Ok, I see. Thanks a lot for the great help again! M. On 28/08/2018 16:05, Christian Grün wrote: You can use the fn:sort function for that: for tumbling window $w in sort( db:open("adatabase")[every $f in $filters satisfies $f(.)], (), function($doc) { db:path($doc) } ) ... Sorting is a blocking operator, though: All documents will need to be checked first in order to tell which one will be the smallest or largest hit. Best, Christian On Tue, Aug 28, 2018 at 4:01 PM Marco Lettere wrote: and what if, a pervert I know, would like to have the docs also globally ordered by any sort criteria? Any chance of squeezing the order by into this elegant FLOWR? Thanks again. M. On 28/08/2018 15:41, Christian Grün wrote: Hi Marco, Here is a minimized representation of your last query: for tumbling window $w in db:open("adatabase")[every $f in $filters satisfies $f(.)] start $first at $s when ($s = 1 + ($page - 1) * $count) end $last at $e when $e - $s = $count - 1 return $w Cheers, Christian On Tue, Aug 28, 2018 at 3:27 PM Marco Lettere wrote: Oh, yes. Thank you Martin. That is obviously a good point. The input is a database with several thousands of documents stored in it. The filters are a dynamic sequence of xpath expressions to be applied on the documents expressed as function references. I need to check whether I can compress all this into a simple predicate as you've shown in your example. where clause would have been much more easier in conjunction with the map operator (!) but if it works I'm going to coope with the predicate. Thanks for your suggestion in the meanwhile. Here a simplified example of my current approach where you could think of $filters as a sequence of boolean functions to be applied to the documents in the db. let $seq := for $doc in db:open("adatabase") where not(false() = ($filters ! (.($doc))) return $doc let $out := for tumbling window $w in $seq start $first at $s when ($s = 1 + ($page - 1) * $count) end $last at $e when $e - $s = $count - 1 return $w Regards, Marco. On 28/08/2018 14:19, Martin Honnen wrote: On 28.08.2018 11:04, Marco Lettere wrote: here's a question related to XQuery, sorry for being slightly off-topic. I'm struggling to find a way to combine the windowing clause and FLOWR in order to get a paged result of a subset of items which respect a given filter. Of course I'm able to get this by first applying the filter to the whole input and then a second FLOWR for the windowing clause. So what is the filter condition? What is the input sequence? The closer I get is [1] which is not what I'd need because I get 2,4,6,8,10 as result for page 1 but I'd really want 10 results per page thus 2,4,6,8,10,12,14,16,18,20. Thanks for any help on this in the meanwhile I'll stick to my naive solution. Marco. [1] let $page := 1 let $count := 10 return for tumbling window $w in (1 to 100) start $first at $s when ($s = 1 + ($page - 1) * $count) end $last at $e when ($e - $s = $count - 1) return $w ! (if (. mod 2 = 0 ) then . else ()) Can't you simply use the filter as a predicate on the expression you use in the windowing for clause? Does let $page-size := 10 for tumbling window $page in (1 to 100)[. mod 2 = 0] start at $sp when $sp mod $page-size = 1 end at $np when ($np + 1) mod $page-size = 1 return {$page} help? It returns 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100
Re: [basex-talk] [XQUERY] Filter and paging with window clause
You can use the fn:sort function for that: for tumbling window $w in sort( db:open("adatabase")[every $f in $filters satisfies $f(.)], (), function($doc) { db:path($doc) } ) ... Sorting is a blocking operator, though: All documents will need to be checked first in order to tell which one will be the smallest or largest hit. Best, Christian On Tue, Aug 28, 2018 at 4:01 PM Marco Lettere wrote: > > and what if, a pervert I know, would like to have the docs also > globally ordered by any sort criteria? > Any chance of squeezing the order by into this elegant FLOWR? > Thanks again. > M. > > On 28/08/2018 15:41, Christian Grün wrote: > > Hi Marco, > > > > Here is a minimized representation of your last query: > > > >for tumbling window $w in > > db:open("adatabase")[every $f in $filters satisfies $f(.)] > >start $first at $s when ($s = 1 + ($page - 1) * $count) > >end $last at $e when $e - $s = $count - 1 > >return $w > > > > Cheers, > > Christian > > > > > > On Tue, Aug 28, 2018 at 3:27 PM Marco Lettere wrote: > >> Oh, yes. Thank you Martin. > >> That is obviously a good point. > >> The input is a database with several thousands of documents stored in it. > >> The filters are a dynamic sequence of xpath expressions to be applied on > >> the documents expressed as function references. > >> I need to check whether I can compress all this into a simple predicate as > >> you've shown in your example. > >> where clause would have been much more easier in conjunction with the map > >> operator (!) but if it works I'm going to coope with the predicate. > >> Thanks for your suggestion in the meanwhile. > >> > >> Here a simplified example of my current approach where you could think of > >> $filters as a sequence of boolean functions to be applied to the documents > >> in the db. > >> > >>let $seq := > >> for $doc in db:open("adatabase") > >> where not(false() = ($filters ! (.($doc))) > >> return $doc > >>let $out := > >> for tumbling window $w in $seq > >> start $first at $s when ($s = 1 + ($page - 1) * $count) > >> end $last at $e when $e - $s = $count - 1 > >> return $w > >> > >> Regards, > >> Marco. > >> > >> On 28/08/2018 14:19, Martin Honnen wrote: > >> > >> On 28.08.2018 11:04, Marco Lettere wrote: > >> > >> here's a question related to XQuery, sorry for being slightly off-topic. > >> > >> I'm struggling to find a way to combine the windowing clause and FLOWR in > >> order to get a paged result of a subset of items which respect a given > >> filter. > >> > >> Of course I'm able to get this by first applying the filter to the whole > >> input and then a second FLOWR for the windowing clause. > >> > >> > >> So what is the filter condition? What is the input sequence? > >> > >> The closer I get is [1] which is not what I'd need because I get > >> 2,4,6,8,10 as result for page 1 but I'd really want 10 results per page > >> thus 2,4,6,8,10,12,14,16,18,20. > >> > >> Thanks for any help on this in the meanwhile I'll stick to my naive > >> solution. > >> > >> Marco. > >> > >> [1] > >> > >> let $page := 1 > >> let $count := 10 > >> return > >> for tumbling window $w in (1 to 100) > >> start $first at $s when ($s = 1 + ($page - 1) * $count) > >> end $last at $e when ($e - $s = $count - 1) > >> return > >> $w ! (if (. mod 2 = 0 ) then . else ()) > >> > >> > >> > >> Can't you simply use the filter as a predicate on the expression you use > >> in the windowing for clause? > >> > >> Does > >> > >> let $page-size := 10 > >> for tumbling window $page in (1 to 100)[. mod 2 = 0] > >>start at $sp when $sp mod $page-size = 1 > >>end at $np when ($np + 1) mod $page-size = 1 > >> return {$page} > >> > >> help? > >> > >> It returns > >> > >> 2 4 6 8 10 12 14 16 18 20 > >> 22 24 26 28 30 32 34 36 38 40 > >> 42 44 46 48 50 52 54 56 58 60 > >> 62 64 66 68 70 72 74 76 78 80 > >> 82 84 86 88 90 92 94 96 98 100 > >> > >> > >> > >> >
Re: [basex-talk] [XQUERY] Filter and paging with window clause
and what if, a pervert I know, would like to have the docs also globally ordered by any sort criteria? Any chance of squeezing the order by into this elegant FLOWR? Thanks again. M. On 28/08/2018 15:41, Christian Grün wrote: Hi Marco, Here is a minimized representation of your last query: for tumbling window $w in db:open("adatabase")[every $f in $filters satisfies $f(.)] start $first at $s when ($s = 1 + ($page - 1) * $count) end $last at $e when $e - $s = $count - 1 return $w Cheers, Christian On Tue, Aug 28, 2018 at 3:27 PM Marco Lettere wrote: Oh, yes. Thank you Martin. That is obviously a good point. The input is a database with several thousands of documents stored in it. The filters are a dynamic sequence of xpath expressions to be applied on the documents expressed as function references. I need to check whether I can compress all this into a simple predicate as you've shown in your example. where clause would have been much more easier in conjunction with the map operator (!) but if it works I'm going to coope with the predicate. Thanks for your suggestion in the meanwhile. Here a simplified example of my current approach where you could think of $filters as a sequence of boolean functions to be applied to the documents in the db. let $seq := for $doc in db:open("adatabase") where not(false() = ($filters ! (.($doc))) return $doc let $out := for tumbling window $w in $seq start $first at $s when ($s = 1 + ($page - 1) * $count) end $last at $e when $e - $s = $count - 1 return $w Regards, Marco. On 28/08/2018 14:19, Martin Honnen wrote: On 28.08.2018 11:04, Marco Lettere wrote: here's a question related to XQuery, sorry for being slightly off-topic. I'm struggling to find a way to combine the windowing clause and FLOWR in order to get a paged result of a subset of items which respect a given filter. Of course I'm able to get this by first applying the filter to the whole input and then a second FLOWR for the windowing clause. So what is the filter condition? What is the input sequence? The closer I get is [1] which is not what I'd need because I get 2,4,6,8,10 as result for page 1 but I'd really want 10 results per page thus 2,4,6,8,10,12,14,16,18,20. Thanks for any help on this in the meanwhile I'll stick to my naive solution. Marco. [1] let $page := 1 let $count := 10 return for tumbling window $w in (1 to 100) start $first at $s when ($s = 1 + ($page - 1) * $count) end $last at $e when ($e - $s = $count - 1) return $w ! (if (. mod 2 = 0 ) then . else ()) Can't you simply use the filter as a predicate on the expression you use in the windowing for clause? Does let $page-size := 10 for tumbling window $page in (1 to 100)[. mod 2 = 0] start at $sp when $sp mod $page-size = 1 end at $np when ($np + 1) mod $page-size = 1 return {$page} help? It returns 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100
Re: [basex-talk] [XQUERY] Filter and paging with window clause
Wow! Works ... of course :-D And I'd say rather fast! Thanks a lot Christian and Martin! Auf bald! On 28/08/2018 15:41, Christian Grün wrote: Hi Marco, Here is a minimized representation of your last query: for tumbling window $w in db:open("adatabase")[every $f in $filters satisfies $f(.)] start $first at $s when ($s = 1 + ($page - 1) * $count) end $last at $e when $e - $s = $count - 1 return $w Cheers, Christian On Tue, Aug 28, 2018 at 3:27 PM Marco Lettere wrote: Oh, yes. Thank you Martin. That is obviously a good point. The input is a database with several thousands of documents stored in it. The filters are a dynamic sequence of xpath expressions to be applied on the documents expressed as function references. I need to check whether I can compress all this into a simple predicate as you've shown in your example. where clause would have been much more easier in conjunction with the map operator (!) but if it works I'm going to coope with the predicate. Thanks for your suggestion in the meanwhile. Here a simplified example of my current approach where you could think of $filters as a sequence of boolean functions to be applied to the documents in the db. let $seq := for $doc in db:open("adatabase") where not(false() = ($filters ! (.($doc))) return $doc let $out := for tumbling window $w in $seq start $first at $s when ($s = 1 + ($page - 1) * $count) end $last at $e when $e - $s = $count - 1 return $w Regards, Marco. On 28/08/2018 14:19, Martin Honnen wrote: On 28.08.2018 11:04, Marco Lettere wrote: here's a question related to XQuery, sorry for being slightly off-topic. I'm struggling to find a way to combine the windowing clause and FLOWR in order to get a paged result of a subset of items which respect a given filter. Of course I'm able to get this by first applying the filter to the whole input and then a second FLOWR for the windowing clause. So what is the filter condition? What is the input sequence? The closer I get is [1] which is not what I'd need because I get 2,4,6,8,10 as result for page 1 but I'd really want 10 results per page thus 2,4,6,8,10,12,14,16,18,20. Thanks for any help on this in the meanwhile I'll stick to my naive solution. Marco. [1] let $page := 1 let $count := 10 return for tumbling window $w in (1 to 100) start $first at $s when ($s = 1 + ($page - 1) * $count) end $last at $e when ($e - $s = $count - 1) return $w ! (if (. mod 2 = 0 ) then . else ()) Can't you simply use the filter as a predicate on the expression you use in the windowing for clause? Does let $page-size := 10 for tumbling window $page in (1 to 100)[. mod 2 = 0] start at $sp when $sp mod $page-size = 1 end at $np when ($np + 1) mod $page-size = 1 return {$page} help? It returns 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100
Re: [basex-talk] [XQUERY] Filter and paging with window clause
Hi Marco, Here is a minimized representation of your last query: for tumbling window $w in db:open("adatabase")[every $f in $filters satisfies $f(.)] start $first at $s when ($s = 1 + ($page - 1) * $count) end $last at $e when $e - $s = $count - 1 return $w Cheers, Christian On Tue, Aug 28, 2018 at 3:27 PM Marco Lettere wrote: > > Oh, yes. Thank you Martin. > That is obviously a good point. > The input is a database with several thousands of documents stored in it. > The filters are a dynamic sequence of xpath expressions to be applied on the > documents expressed as function references. > I need to check whether I can compress all this into a simple predicate as > you've shown in your example. > where clause would have been much more easier in conjunction with the map > operator (!) but if it works I'm going to coope with the predicate. > Thanks for your suggestion in the meanwhile. > > Here a simplified example of my current approach where you could think of > $filters as a sequence of boolean functions to be applied to the documents in > the db. > > let $seq := > for $doc in db:open("adatabase") > where not(false() = ($filters ! (.($doc))) > return $doc > let $out := > for tumbling window $w in $seq > start $first at $s when ($s = 1 + ($page - 1) * $count) > end $last at $e when $e - $s = $count - 1 > return $w > > Regards, > Marco. > > On 28/08/2018 14:19, Martin Honnen wrote: > > On 28.08.2018 11:04, Marco Lettere wrote: > > here's a question related to XQuery, sorry for being slightly off-topic. > > I'm struggling to find a way to combine the windowing clause and FLOWR in > order to get a paged result of a subset of items which respect a given filter. > > Of course I'm able to get this by first applying the filter to the whole > input and then a second FLOWR for the windowing clause. > > > So what is the filter condition? What is the input sequence? > > The closer I get is [1] which is not what I'd need because I get 2,4,6,8,10 > as result for page 1 but I'd really want 10 results per page thus > 2,4,6,8,10,12,14,16,18,20. > > Thanks for any help on this in the meanwhile I'll stick to my naive solution. > > Marco. > > [1] > > let $page := 1 > let $count := 10 > return >for tumbling window $w in (1 to 100) >start $first at $s when ($s = 1 + ($page - 1) * $count) >end $last at $e when ($e - $s = $count - 1) >return > $w ! (if (. mod 2 = 0 ) then . else ()) > > > > Can't you simply use the filter as a predicate on the expression you use in > the windowing for clause? > > Does > > let $page-size := 10 > for tumbling window $page in (1 to 100)[. mod 2 = 0] > start at $sp when $sp mod $page-size = 1 > end at $np when ($np + 1) mod $page-size = 1 > return {$page} > > help? > > It returns > > 2 4 6 8 10 12 14 16 18 20 > 22 24 26 28 30 32 34 36 38 40 > 42 44 46 48 50 52 54 56 58 60 > 62 64 66 68 70 72 74 76 78 80 > 82 84 86 88 90 92 94 96 98 100 > > > >
Re: [basex-talk] [XQUERY] Filter and paging with window clause
Oh, yes. Thank you Martin. That is obviously a good point. The input is a database with several thousands of documents stored in it. The filters are a dynamic sequence of xpath expressions to be applied on the documents expressed as function references. I need to check whether I can compress all this into a simple predicate as you've shown in your example. where clause would have been much more easier in conjunction with the map operator (!) but if it works I'm going to coope with the predicate. Thanks for your suggestion in the meanwhile. Here a simplified example of my current approach where you could think of /$filters/ as a sequence of boolean functions to be applied to the documents in the db. let $seq := for $doc in db:open("adatabase") where not(false() = ($filters ! (.($doc))) return $doc let $out := for tumbling window $w in $seq start $first at $s when ($s = 1 + ($page - 1) * $count) end $last at $e when $e - $s = $count - 1 return $w Regards, Marco. On 28/08/2018 14:19, Martin Honnen wrote: On 28.08.2018 11:04, Marco Lettere wrote: here's a question related to XQuery, sorry for being slightly off-topic. I'm struggling to find a way to combine the windowing clause and FLOWR in order to get a paged result of a subset of items which respect a given filter. Of course I'm able to get this by first applying the filter to the whole input and then a second FLOWR for the windowing clause. So what is the filter condition? What is the input sequence? The closer I get is [1] which is not what I'd need because I get 2,4,6,8,10 as result for page 1 but I'd really want 10 results per page thus 2,4,6,8,10,12,14,16,18,20. Thanks for any help on this in the meanwhile I'll stick to my naive solution. Marco. [1] let $page := 1 let $count := 10 return for tumbling window $w in (1 to 100) start $first at $s when ($s = 1 + ($page - 1) * $count) end $last at $e when ($e - $s = $count - 1) return $w ! (if (. mod 2 = 0 ) then . else ()) Can't you simply use the filter as a predicate on the expression you use in the windowing for clause? Does let $page-size := 10 for tumbling window $page in (1 to 100)[. mod 2 = 0] start at $sp when $sp mod $page-size = 1 end at $np when ($np + 1) mod $page-size = 1 return {$page} help? It returns 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100
Re: [basex-talk] [XQUERY] Filter and paging with window clause
On 28.08.2018 11:04, Marco Lettere wrote: here's a question related to XQuery, sorry for being slightly off-topic. I'm struggling to find a way to combine the windowing clause and FLOWR in order to get a paged result of a subset of items which respect a given filter. Of course I'm able to get this by first applying the filter to the whole input and then a second FLOWR for the windowing clause. So what is the filter condition? What is the input sequence? The closer I get is [1] which is not what I'd need because I get 2,4,6,8,10 as result for page 1 but I'd really want 10 results per page thus 2,4,6,8,10,12,14,16,18,20. Thanks for any help on this in the meanwhile I'll stick to my naive solution. Marco. [1] let $page := 1 let $count := 10 return for tumbling window $w in (1 to 100) start $first at $s when ($s = 1 + ($page - 1) * $count) end $last at $e when ($e - $s = $count - 1) return $w ! (if (. mod 2 = 0 ) then . else ()) Can't you simply use the filter as a predicate on the expression you use in the windowing for clause? Does let $page-size := 10 for tumbling window $page in (1 to 100)[. mod 2 = 0] start at $sp when $sp mod $page-size = 1 end at $np when ($np + 1) mod $page-size = 1 return {$page} help? It returns 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100
[basex-talk] [XQUERY] Filter and paging with window clause
Hi all, here's a question related to XQuery, sorry for being slightly off-topic. I'm struggling to find a way to combine the windowing clause and FLOWR in order to get a paged result of a subset of items which respect a given filter. Of course I'm able to get this by first applying the filter to the whole input and then a second FLOWR for the windowing clause. But I was wondering whether it's possible to streamline this into one single FLOWR. Two bonus questions: 1. Will this actually be more efficient than the naive (two FLOWR) solution or is the almighty optimizer able to blend the two subsequent FLOWR on its own? 2. What if the input is unordered and I also would like to introduce sorting? The closer I get is [1] which is not what I'd need because I get 2,4,6,8,10 as result for page 1 but I'd really want 10 results per page thus 2,4,6,8,10,12,14,16,18,20. Thanks for any help on this in the meanwhile I'll stick to my naive solution. Marco. [1] let $page := 1 let $count := 10 return for tumbling window $w in (1 to 100) start $first at $s when ($s = 1 + ($page - 1) * $count) end $last at $e when ($e - $s = $count - 1) return $w ! (if (. mod 2 = 0 ) then . else ())
[basex-talk] ThreadLocal error in Tomcat
Hello all, I am currently using BaseX in embedded mode as a XQuery processor in a tomcat webapplication. I am receiving some XML, create a BaseX in memory database, execute some XQuery, then close the context. But when I stop tomcat or reload the web application, I have a lot of errors saying: SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [webap] created a ThreadLocal with key of type [java.lang.ThreadLocal.SuppliedThreadLocal] (value [java.lang.ThreadLocal$SuppliedThreadLocal@60506a99]) and a value of type [org.basex.query.expr.path.PathCache] (value [org.basex.query.expr.path.PathCache@665cfafa]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Is there a way to avoid that error, by forcibly clearing these cache or something ? Thanks Simon
Re: [basex-talk] Strange index values with numerics
Hi all, This constant's name is somhow misleading, Because it seems to contain the smallest positive value actually, Not the biggest negative one [1] : [1] https://docs.oracle.com/javase/7/docs/api/java/lang/Double.html#MIN_VALUE Hoping it helps, Best regards, Fabrice -Message d'origine- De : BaseX-Talk [mailto:basex-talk-boun...@mailman.uni-konstanz.de] De la part de Christian Grün Envoyé : mardi 28 août 2018 09:07 À : Zachary N. Dean Cc : BaseX Objet : Re: [basex-talk] Strange index values with numerics Hi Zack, I helps indeed! I learnt that -Double.MAX_VALUE is smaller than Double.MIN_VALUE in Java. The fix turned out to be pretty straightforward [1]; a new stable snapshot is available [2]. Have fun, Christian [1] https://github.com/BaseXdb/basex/issues/1616 [2] http://files.basex.org/releases/latest/ On Mon, Aug 27, 2018 at 10:41 PM Zachary N. Dean wrote: > > Hi, > > I was recently taking a look into the index data files (for reasons) and came > across something that I found strange... > > > > When numeric values are in nodes they are put into the index with min/max and > distinct token values, which is cool… > > What's strange is, when negative integer values are in text and attribute > nodes the index contains the minimum value correctly, but the maximum value > is '4.9E-324' ([0,0,0,0,0,0,0,1]). > > This doesn't seem to happen with positive values. > > Now, with small value ranges I assume this is okay, but with many values I > would imagine it could slow things down. > > > > Not sure if this is a bug or a feature, so I figured I'd bring it up. > > > > Here an example: > > > > -1 > > 0 > > 1 > > -5 > > -49000 > > 2 > > 3 > > > > -1 > > 1 > > > > > > I would have assumed that the index would see that element "d" has a min of > -5 and a max of -49000. > > > > Here the index infos: > > > > Elements > > - Structure: Hash > > - Entries: 8 > > g 2x, 2 distinct integers [-1, 1], leaf > > e 2x, 2 distinct integers [2, 3], leaf > > d 2x, 2 distinct integers [-5, 4.9E-324], leaf > > c 1x, integer [1, 1], leaf > > f 1x, leaf > > r 1x > > a 1x, integer [-1, 4.9E-324], leaf > > b 1x, integer [0, 4.9E-324], leaf > > > > Attributes > > - Structure: Hash > > - Entries: 1 > > a 1x, integer [-1, 4.9E-324], leaf > > > > > > If it's a feature, then cool. Keep on rockin'! If not, then I hope this helps > a little. > > > > Thanks, > > > > Zack Dean
Re: [basex-talk] Strange index values with numerics
Hi Zack, I helps indeed! I learnt that -Double.MAX_VALUE is smaller than Double.MIN_VALUE in Java. The fix turned out to be pretty straightforward [1]; a new stable snapshot is available [2]. Have fun, Christian [1] https://github.com/BaseXdb/basex/issues/1616 [2] http://files.basex.org/releases/latest/ On Mon, Aug 27, 2018 at 10:41 PM Zachary N. Dean wrote: > > Hi, > > I was recently taking a look into the index data files (for reasons) and came > across something that I found strange... > > > > When numeric values are in nodes they are put into the index with min/max and > distinct token values, which is cool… > > What's strange is, when negative integer values are in text and attribute > nodes the index contains the minimum value correctly, but the maximum value > is '4.9E-324' ([0,0,0,0,0,0,0,1]). > > This doesn't seem to happen with positive values. > > Now, with small value ranges I assume this is okay, but with many values I > would imagine it could slow things down. > > > > Not sure if this is a bug or a feature, so I figured I'd bring it up. > > > > Here an example: > > > > -1 > > 0 > > 1 > > -5 > > -49000 > > 2 > > 3 > > > > -1 > > 1 > > > > > > I would have assumed that the index would see that element "d" has a min of > -5 and a max of -49000. > > > > Here the index infos: > > > > Elements > > - Structure: Hash > > - Entries: 8 > > g 2x, 2 distinct integers [-1, 1], leaf > > e 2x, 2 distinct integers [2, 3], leaf > > d 2x, 2 distinct integers [-5, 4.9E-324], leaf > > c 1x, integer [1, 1], leaf > > f 1x, leaf > > r 1x > > a 1x, integer [-1, 4.9E-324], leaf > > b 1x, integer [0, 4.9E-324], leaf > > > > Attributes > > - Structure: Hash > > - Entries: 1 > > a 1x, integer [-1, 4.9E-324], leaf > > > > > > If it's a feature, then cool. Keep on rockin'! If not, then I hope this helps > a little. > > > > Thanks, > > > > Zack Dean