[h2] Re: Main differeces between 1.3 and 1.4 versions

2016-10-18 Thread Adam McMahon
Good info here

So, what version of 1.4x would you use in your production environment.   I 
use pagestore for JDBC, but am also going to be integrating MVSTORE via the 
map api (not JDBC) using its OffHeapStore.  What version would you 
recommend.

Thanks,

-Adam

On Tuesday, October 18, 2016 at 4:24:33 PM UTC-4, Petr Holík wrote:
>
> Hello,
>
> I've done some investigation of relation between 1.3(stable) and1.4(beta) 
> - Hope it somebody helps to pick proper version for conrete suits.
> Please feel free to correct me:
>
>  * Development of version 1.3 is discontinued - all bugs found are fixed 
> only in 1.4 version
>  * Git branch tagged version1.3 only contains snapshot of released sources 
> of particular 1.3 versions and there is not and WILL NOT be any further 
> development
>  * 1.4 is Beta because of new MV_STORE which is default since 1.4.177 AND 
> because of MVCC enabled
>  * 1.4 can be used for production same as 1.3 when 
> ;MV_STORE=FALSE;MVCC=FALSE  is appended to JDBC URL (MVCC is now disabled 
> when not using MV_STORE - so potetionally can be omited)
>  * MV_STORE has few data corruption issues  but since 2015-10-11 is there 
> was no new one
>  * MV_STORE should now have pretty similar performance as old one but 
> delivers some new cool Map-Like  features, which can be used 
> directly.
>  * There are no _unfixed known bugs_ on MV_STORE but there still exists 
> few open data corruption bugs related to this store(which may or may not be 
> caused by it)
>
>
> Sincerely Petr Holik
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Main differeces between 1.3 and 1.4 versions

2016-10-18 Thread Petr Holík
Hello,

I've done some investigation of relation between 1.3(stable) and1.4(beta) - 
Hope it somebody helps to pick proper version for conrete suits.
Please feel free to correct me:

 * Development of version 1.3 is discontinued - all bugs found are fixed 
only in 1.4 version
 * Git branch tagged version1.3 only contains snapshot of released sources 
of particular 1.3 versions and there is not and WILL NOT be any further 
development
 * 1.4 is Beta because of new MV_STORE which is default since 1.4.177 AND 
because of MVCC enabled
 * 1.4 can be used for production same as 1.3 when 
;MV_STORE=FALSE;MVCC=FALSE  is appended to JDBC URL (MVCC is now disabled 
when not using MV_STORE - so potetionally can be omited)
 * MV_STORE has few data corruption issues  but since 2015-10-11 is there 
was no new one
 * MV_STORE should now have pretty similar performance as old one but 
delivers some new cool Map-Like  features, which can be used 
directly.
 * There are no _unfixed known bugs_ on MV_STORE but there still exists few 
open data corruption bugs related to this store(which may or may not be 
caused by it)


Sincerely Petr Holik

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Re: MVstore - off heap storage

2016-10-18 Thread Adam McMahon
>[4] Can we persist to disk the contents in an OffHeapStore (take a 
snapshot to disk and then reload it when the app restarts)?

I think [4] has a pretty simple implementation.  When a user wants to save 
to disk, just create a temporary FileStore, and copy all the key-values 
from the Off-Heap-Store into the FileStore map(s), and the commit and close.

This could be built into to the OffHeapStore as a function: public void 
saveToFile(fileName), and a corresponding loadFromFile(fileName) that does 
the reverse.  But it could just as easily be done by the applilcation 
programmer instead of being built into the OffHeapStore class.

-Adam



On Monday, October 17, 2016 at 7:27:43 PM UTC-4, Adam McMahon wrote:
>
> Hi,
>
> I am a long time user of H2, but I am now just exploring the MVstore map 
> api.   Great stuff, a few questions:
>
> [1]  Off heap storage - is there any way to designate the size of the 
> offheap store, or does it just continue to fill up until it runs out of 
> memory?
>
> [2]  Off heap storage - Can we  designate how much of the map should be in 
> heap vs offheap?
>
> [3] Can the Off heap storage be used in conjunction with an overflow file 
> storage (for example, if so much memory is used it overflows to a file?
>
> [4] Can we persist to disk the contents in an OffHeapStore (take a 
> snapshot to disk and then reload it when the app restarts)?
>
> Best,
>
> -Adam
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Re: Entries in a table containing Geometries cannot be found when the Geometry is empty ( Row not found when trying to delete from index )

2016-10-18 Thread Sven
Hi,

Nicolas, thanks for the remark, and sorry for not providing an example. I 
do have the latest version so the handling of null geometries is up to 
date. One test function that has been added in the pull request you 
mentioned only checks for a small table (size one I believe). However, in 
that case, the spatial key is not used for lookup because the MVTree is 
small enough to contain only leaves.


Here is a small example that yields the error I mean. Note that the test 
script *passes for small table sizes.*

public void testIndexUpdateNullGeometry2() throws SQLException {
deleteDb("spatial");
Connection conn = getConnection(URL);
Statement stat = conn.createStatement();
stat.execute("drop table if exists DUMMY_11;");
stat.execute(
"CREATE TABLE PUBLIC.DUMMY_11 (fid serial,  GEOM GEOMETRY, Name 
varchar(255));");
stat.execute("CREATE SPATIAL INDEX PUBLIC_DUMMY_11_SPATIAL_INDEX on"
+ " PUBLIC.DUMMY_11(GEOM);");
for (int i = 0; i < 100; i++) {
stat.execute("insert into PUBLIC.DUMMY_11(geom) values(null);");
}
stat.execute("update PUBLIC.DUMMY_11 set Name='test' where fid = 5");
conn.close();
deleteDb("spatial");
}



The row fails to be found here, because with larger tables, the root Page 
is not a leaf any more, relying on the above mentioned contains relation...

protected Object get(Page p, Object key) {
if (!p.isLeaf()) {
List l = new ArrayList();
for (int i = 0; i < p.getKeyCount(); i++) {
Object o = get(p.getChildPage(i), key);
if (o != null) {
l.add(o);
}
}
for (int i = 0; i < p.getKeyCount(); i++) {
if (contains(p, i, key)) {
Object o = get(p.getChildPage(i), key);
if (o != null) {
return o;
}
}
}
} else
{
for (int i = 0; i < p.getKeyCount(); i++) {
if (keyType.equals(p.getKey(i), key)) {
return p.getValue(i);
}
}
}
return null;
}


kind regards,

Sven

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Re: Entries in a table containing Geometries cannot be found when the Geometry is empty ( Row not found when trying to delete from index )

2016-10-18 Thread Nicolas Fortin (OrbisGIS)
Hi,

A Pull request has been merged about the handling of null geometries:

https://github.com/h2database/h2database/pull/267/files

You don't provide any sql sample of the query and the expected result. So I 
don't understand your question.

Regards,

Le mardi 18 octobre 2016 08:40:35 UTC+2, Sven a écrit :
>
> I forgot another way to find such keys, maybe this is even safer. Couldn't 
> the *Page *be passed down to the *contains *function and perform a binary 
> search on the key in question?
>
> public boolean contains(Page p, int index, Object key) {
> SpatialKey a = (SpatialKey) p.getKey(index);
> SpatialKey b = (SpatialKey) key;
>
> if (a.isNull() || b.isNull()) {
> return p.binarySearch(a) >= 0; // <
> }
> for (int i = 0; i < dimensions; i++) {
> if (a.min(i) > b.min(i) || a.max(i) < b.max(i)) {
> return false;
> }
> }
> return true;
> }
>
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Re: Entries in a table containing Geometries cannot be found when the Geometry is empty ( Row not found when trying to delete from index )

2016-10-18 Thread Sven
I forgot another way to find such keys, maybe this is even safer. Couldn't 
the *Page *be passed down to the *contains *function and perform a binary 
search on the key in question?

public boolean contains(Page p, int index, Object key) {
SpatialKey a = (SpatialKey) p.getKey(index);
SpatialKey b = (SpatialKey) key;

if (a.isNull() || b.isNull()) {
return p.binarySearch(a) >= 0; // <
}
for (int i = 0; i < dimensions; i++) {
if (a.min(i) > b.min(i) || a.max(i) < b.max(i)) {
return false;
}
}
return true;
}



-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] MVstore - off heap storage

2016-10-18 Thread Noel Grandin



On 2016/10/18 1:27 AM, Adam McMahon wrote:

[1]  Off heap storage - is there any way to designate the size of the offheap 
store, or does it just continue to fill up
until it runs out of memory?

[2]  Off heap storage - Can we  designate how much of the map should be in heap 
vs offheap?

[3] Can the Off heap storage be used in conjunction with an overflow file 
storage (for example, if so much memory is
used it overflows to a file?

[4] Can we persist to disk the contents in an OffHeapStore (take a snapshot to 
disk and then reload it when the app
restarts)?


No to all of the above.

[1] should be straightforward to implement, feel free to submit a patch.

The others would all be much trickier, and I don't see the real value, but I 
wouldn't reject patches.

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.