Re: in-memory h2 db performance

2011-05-06 Thread Thomas Mueller
Hi, > Is there anyway to use same connection without trying to get the connection > every time in the spring? I know it is outside but if you know please let me > know. You should use a 'real' connection pool. See http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/jdbc/dat

Re: in-memory h2 db performance

2011-04-19 Thread suresh kumar
Thomas, From the thread dump I found that "pool-2-thread-43" & "pool-2-thread-110" are on same database. So it make sense to "pool-2-thread-43" is blocked by "pool-2-thread-110". DriverManager.java synchronized on private static synchronized Connection getConnection( String url, java.ut

Re: in-memory h2 db performance

2011-04-19 Thread suresh kumar
Thomas, Here is the thread dump. All the threads are blocked on "pool-2-thread-43" which is blocked by "pool-2-thread-110" "pool-2-thread-50" - Thread t@88 java.lang.Thread.State: BLOCKED on java.lang.Class@1308abb owned by: pool-2-thread-43 at java.sql.DriverManager.getConnectio

Re: in-memory h2 db performance

2011-04-19 Thread suresh kumar
Thomas, I am in the assumption that if I use separate database for each table the syn on the executeQuery should do only database. But when I look at the thread-dump all the queries are blocked by single thread (even they are on different database). Here are the connection urls of each db.

Re: in-memory h2 db performance

2011-04-09 Thread Thomas Mueller
Hi, >           Can I create separate data base for each table? The tables are not > related to each other. > Can this help? Yes, I believe this would help. Regards, Thomas -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group,

Re: in-memory h2 db performance

2011-04-09 Thread suresh kumar
Thomas, Can I create separate data base for each table? The tables are not related to each other. Can this help? Thanks, Suresh On Fri, Mar 4, 2011 at 5:39 PM, suresh kumar wrote: > Thomas, > > > > Does the update statement use an index? To find out, use EXPLAIN UPDATE > ... > Yes it

Re: in-memory h2 db performance

2011-03-04 Thread suresh kumar
Thomas, > Does the update statement use an index? To find out, use EXPLAIN UPDATE ... Yes it uses. > Is the update performance OK if there are no queries running? Yes if there are no or few queries then the update performance is good. Thanks, Suresh On Thu, Mar 3, 2011 at 1:02 AM, Thomas Muel

Re: in-memory h2 db performance

2011-03-02 Thread Thomas Mueller
Hi, > The above query took more than 1 sec per row update. Does the update statement use an index? To find out, use EXPLAIN UPDATE ... > I would like to know why the updating the table with 3k rows taking longer > time when concurrent read requests are there? > Is there any configuration setting

Re: in-memory h2 db performance

2011-02-26 Thread suresh kumar
Hi Thomas, Actually first one is ATTR1 not ATTR2, typo error when changing the actual column names. WHERE ATTR1 = 9 AND ATTR2 IN () AND ATTR4 IN (.) The use cause is for reporting. we have web application and we should present data in graphs and tables. "n" number of concurrent users

Re: in-memory h2 db performance

2011-02-24 Thread Thomas Mueller
Hi, Are you completely sure this is the query? WHERE ATTR2 = 9 AND ATTR2 IN () This sounds like it would never return rows? No matter if that's correct or not, why do you use such a large list of IN() values? I could optimize the code for this case, and I will add it to the roadmap. However, I

Re: in-memory h2 db performance

2011-02-21 Thread suresh kumar
Hi Thomas, I have verified the queries with EXPLAIN ANAYLYZE, the queries are using right indexes. Here I am giving the query sample and schema structure. Query sample: SELECT ATTR1, MAX(ATTR10) AS ATTR10, SUM(ATTR11) AS ATTR11,SUM(ATTR12) AS ATTR12, SUM(ATTR13)

Re: in-memory h2 db performance

2011-02-17 Thread Thomas Mueller
Hi, It looks like you are using a query that contains a condition of the form "column IN (...)". This query seems to be slow. I guess you need to analyze your application and check if the right indexes exist. Obviously, I can't say what is slow and why because I don't have your application. See al

Re: in-memory h2 db performance

2011-02-15 Thread Thomas Mueller
Hi, I guess the mail from Eliran Bivas (CHARACTER SET) was simply in the wrong thread. Regards, Thomas -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to h2-database@googlegroups.com. To unsubscribe from this g

Re: in-memory h2 db performance

2011-02-15 Thread Thomas Mueller
Hi, Could you use the profiling tool to find out what is taking so long? To use it: org.h2.util.Profiler prof = new org.h2.util.Profiler(); prof.interval = 1; prof.startCollecting(); // ... your code ... // System.out.println(prof.getTop(10)); I have some guesses (maybe you don't use prepared st

Re: in-memory h2 db performance

2011-02-15 Thread Sergi Vladykin
Hi, Try to use hash index on a single column with the most unique values (of course this column should be in where clause). But better use profiler and find where h2 spends time. Also may be you should use your own data structures instead of database if it is possible in your case. regards, Sergi

Re: in-memory h2 db performance

2011-02-15 Thread suresh kumar
Panayiotis Vlissidis, I am using prepared statements, even I tried with batch updates (with statement, couldn't use prepared statement in batch updates). The difference in db size after adding multi-column index is 1 KB. Thanks, Suresh On Tue, Feb 15, 2011 at 2:04 PM, Panayiotis Vlissidis

Re: in-memory h2 db performance

2011-02-15 Thread Panayiotis Vlissidis
Hello, Thanks for the update and nice to know it worked. Sorry to hear that it's still above 1 sec, maybe someone else can provide more suggestions. You should also have a look here: http://www.h2database.com/html/performance.html#database_performance_tuning The easiest things to start with(in c

Re: in-memory h2 db performance

2011-02-15 Thread suresh
Eliran, Sorry, i didn't get your question on script and CHARACTER SET. if you are taking about \n\t\t, the sql scripts are externalized in the a config file. It has new lines and tabs in the query. Thanks, Suresh On Feb 14, 8:38 pm, Eliran Bivas wrote: > As you probably can tell, this is

Re: in-memory h2 db performance

2011-02-15 Thread suresh
Panayiotis Vlissidis, Thanks a lot for the reply. I made the changes as you suggested. Created multi-column indexes. The time taken to update the table is 1.5 sec instead of 2 sec with MULTI_THREADED=1. Thanks, Suresh On Feb 14, 6:36 pm, suresh wrote: > Hi, > >        I am using in-

Re: in-memory h2 db performance

2011-02-14 Thread Eliran Bivas
As you probably can tell, this is done automatically and not with provided scripts I can modify. The create table statement comes prior to index creation. It seems like the phrase "CHARACTER SET" isn't recognized and somehow should be avoided when parsed. Eliran Bivas -- co-founder and editor of

Re: in-memory h2 db performance

2011-02-14 Thread Panayiotis Vlissidis
Hello, I am no expert but I think that creating multi-column indexes based on the combination of columns that appear in the where clause could help improve the performance of your queries. e.g. (based on the SQL you provided) CREATE INDEX IF NOT EXISTS comb_index_name ON CURRENT_VA

in-memory h2 db performance

2011-02-14 Thread suresh
Hi, I am using in-memory h2 db and I have 8 tables. Each table has 15 to 20 columns. One table with 60 columns. I have two indexes per table. Each table will have at most 3k rows. Every 5 sec I am updating these tables with new data. I am updating/inserting/deleting based on the de