Hi,

> About "envelope query" the real issue is that the variable intersects is
not set to null at the beginning of find method

Ah, I see! Does setting it to null there solve the problem? In any case, I
will try to create a test case for this. It might take some time however,
as I'm not familiar with this.

> Is it ok to store MVRTreeMap in the DataBase.mvStore

Do you mean add it in the inner class MVTableEngine.Store? Yes that's
possible. At some point it should be just an index I guess (so it should
reside in MVTable.indexes), but doing that later on is fine.

Regards,
Thomas





On Thu, Jul 11, 2013 at 11:38 AM, Nicolas Fortin (OrbisGIS) <
[email protected]> wrote:

> Thanks for your help, I will try to take less of your time in the
> following days :/
>
> About "envelope query" the real issue is that the variable intersects is
> not set to null at the beginning of find method:
>
> https://github.com/nicolas-f/h2database/blob/svnmaster/h2/src/main/org/h2/index/IndexCursor.java#L76
>
> About "Corrupt page count", I will try to create a unit test to reproduce
> this, but it is not easy, it may require huge index to reproduce.
>
> Is it ok to store MVRTreeMap in the DataBase.mvStore or it should work
> better if it is placed on a separate file ?
>
>
> Regards,
>
> -Nicolas Fortin
> GIS Workshop
> IRSTV FR CNRS 2488
>
> Le jeudi 11 juillet 2013 11:20:09 UTC+2, Thomas Mueller a écrit :
>>
>> Hi,
>>
>> About "envelope query", you wrote "With index and Envelope union it take
>> more than 100s." - do you mean the following line in IndexCursor.
>> getSpatialSearchRo**w is called: "v = ((ValueGeometry) v).union(vg);"?
>> If yes, how is it possible, because the method is only ever called with the
>> parameter "isIntersects" set to true. The method is only called within
>> IndexCursor.find, where isIntersect is set to true.
>>
>> About "Corrupt page count": I don't think it's because you directly use
>> a map. More likely is a bug within the MVStore, for example related to
>> concurrency. I do know that currently, the MVTableEngine doesn't always
>> work correctly when using multiple threads, so maybe there is a concurrency
>> problem in the MVStore that needs to be fixed. If not, then more likely is
>> another problem in the MVStore. I could have a look if I have a test case.
>>
>> Regards,
>> Thomas
>>
>>
>>
>>
>> On Thu, Jul 11, 2013 at 9:10 AM, Nicolas Fortin (OrbisGIS) <
>> [email protected]> wrote:
>>
>>> Hi Thomas,
>>>
>>> By using the good envelope query, in my performance test your MVRTreeMap
>>> is not far from JTS STRTree.
>>>
>>> In my sql request (count roads inside several areas):
>>>
>>>> select AREA.NAME,AREA.ID, COUNT(ROAD.ID) roadcount from AREA, ROAD
>>>> WHERE AREA.the_geom && ROAD.the_geom GROUP BY AREA.NAME,AREA.ID ORDER
>>>> BY AREA.NAME,AREA.ID;
>>>
>>>
>>> Without index, it takes ~9 s . With index and Envelope union it take
>>> more than 100s. With index and without envelope union it takes ~1s.
>>>
>>> I guess that Noel have done the same thing that you have done for
>>> interval numeric search. I will wrote a test case on that part.
>>>
>>> Currently I have the following StackTrace:
>>>
>>> 07-11 09:06:00 database: flush
>>>> java.lang.**IllegalStateException: Corrupt page count -1 [1.3.172]
>>>>     at org.h2.mvstore.DataUtils.**newIllegalStateException(**
>>>> DataUtils.java:632)
>>>>     at org.h2.mvstore.MVStore.**applyFreedPages(MVStore.java:**1004)
>>>>     at org.h2.mvstore.MVStore.store(**MVStore.java:871)
>>>>     at org.h2.mvstore.MVStore.store(**MVStore.java:779)
>>>>     at org.h2.mvstore.MVStore.**compact(MVStore.java:1197)
>>>>     at org.h2.mvstore.db.**MVTableEngine$Store.store(**
>>>> MVTableEngine.java:132)
>>>>     at org.h2.engine.Database.flush(**Database.java:1818)
>>>>     at org.h2.store.WriterThread.run(**WriterThread.java:87)
>>>>     at java.lang.Thread.run(Thread.**java:662)
>>>>
>>>
>>> I guess it is because I use directly store.openMap with main MVStore
>>> here:
>>> https://github.com/nicolas-f/**h2database/blob/patch-merge/**
>>> h2/src/main/org/h2/index/**SpatialTreeIndex.java#L95<https://github.com/nicolas-f/h2database/blob/patch-merge/h2/src/main/org/h2/index/SpatialTreeIndex.java#L95>
>>> I will do the same thing as you, using Transaction, hope that it will
>>> fix corrupt page issue:
>>> https://github.com/nicolas-f/**h2database/blob/patch-merge/**
>>> h2/src/main/org/h2/mvstore/db/**MVSecondaryIndex.java#L69<https://github.com/nicolas-f/h2database/blob/patch-merge/h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java#L69>
>>>
>>> Regards,
>>>
>>> -Nicolas Fortin
>>> GIS Workshop
>>> IRSTV FR CNRS 2488
>>>
>>> Le mercredi 10 juillet 2013 21:45:47 UTC+2, Thomas Mueller a écrit :
>>>>
>>>> Hi,
>>>>
>>>> > I have performance issues with the spatial index
>>>>
>>>> I don't think it's because of your change. Please note some features
>>>> are still missing or are not optimised at all. If you could post a
>>>> test case that would be great, I will then try to find the problem.
>>>>
>>>> Regards,
>>>> Thomas
>>>>
>>>>
>>>> On Wed, Jul 10, 2013 at 8:54 AM, Nicolas Fortin (OrbisGIS) <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi Thomas,
>>>>>
>>>>> Ok nice, way better than a random test case. I have performance issues
>>>>> with the spatial index, maybe my fix introduce processing overhead. I will
>>>>> try to use your profiler, or the IntellliJ one..
>>>>>
>>>>> Regards,
>>>>>
>>>>> -Nicolas Fortin
>>>>> GIS Workshop
>>>>> IRSTV FR CNRS 2488
>>>>>
>>>>> Le lundi 8 juillet 2013 20:35:58 UTC+2, Thomas Mueller a écrit :
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> By the way, I now have a reproducible test case for the bug with the
>>>>>> MVRTreeMap (the one you fixed in your version).
>>>>>>
>>>>>> Regards,
>>>>>> Thomas
>>>>>>
>>>>>  --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "H2 Database" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to h2-database...@**googlegroups.**com.
>>>>> To post to this group, send email to [email protected].
>>>>>
>>>>> Visit this group at 
>>>>> http://groups.google.com/**group**/h2-database<http://groups.google.com/group/h2-database>
>>>>> .
>>>>> For more options, visit 
>>>>> https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
>>>>> .
>>>>>
>>>>>
>>>>>
>>>>
>>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "H2 Database" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to h2-database...@**googlegroups.com.
>>> To post to this group, send email to [email protected].
>>> Visit this group at 
>>> http://groups.google.com/**group/h2-database<http://groups.google.com/group/h2-database>
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to