On Sat, 2008-07-19 at 11:53 +0200, Sascha Fahl wrote: > last week I realized an approach for GeoSort in lucene. Inspired by > "Lucene in action" I modified the algorithm in the following way. When > an IndexReader for a certain index is created, a cache for > geoinformation is created - this simply is a 2 dimensional int Array. > So it is possible to cache geoinformation for 1.000.000 docs in around > 8 MB.
Be aware that arrays in themselves take up a fair amount of memory, so you'll want to use only 3 arrays in total and not 1000001: int[][] coordinates = new int[2]; coordinates[0] = new int[1000000]; coordinates[1] = new int[1000000]; [...] > What do you think about this approach? Sounds fine when the index rarely changes. > The only possible advantage is the cache I think because I do not really > know if the JVM is good in handling 10 MB of data in the RAM. The Sun JVM is perfectly capable of handling large arrays efficiently. We use an array-based structure of ints and longs for quick facet look up that is approximately 300MB. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]