JPAContainer the very slow !when Query the data behind

I used vaadin7.0 beta10. glassfish3.2 psostgresql ,

My code is very simple
TableQuery tq= new TableQuery(“acmbooks”, jpool); //acmbooks istable in postgresQL,

              SQLContainer container = new SQLContainer(tq);  
               。。。。。。。
                              table.setContainerDataSource( container );
                                      table.setPageLength(15);

Very very slowly !!when JPAContainer use table display data,
when I quickly drag the slider,
my database only records 180,000 postgresQL process cpu utilization is very high, 45%.

I replace the pagetable and to display the data,
Quick Click "next page
, there have long to wait very high, postgresQL process cpu usage is very high too

What can I do for this problem ? Or is a bug?

Thanks very much!

JPAContainer != SQLContainer

These are two VERY different things…

But I would take a guess that you are lacking an Index/ Primary index?
Have not used SQLContainer so I’m not sure if they use a cursor/scrollable result set, so it might be SQLContainer simly tries to reed the entire table ??

I give the table index, the problem any natural existence.I’ve used vaadin 6.7 did not find this problem, use vaadin7, quickly drag the scroll bar, or a quick click on the next page, easily long wait vaadin the upper right corner of the page becomes red waiting tospend 2-3 minutes to come out data, and other clients can not access at this time, feeling like a lock table, but the background without any error!

Hello!

I using JPA Container with Hibernate and I have a problem. When I display data from data base to vaadin table, in console I see many tons sql queries - for each entity - query. Therefore page with table loading very slowly… what’s the problem ?


https://vaadin.com/forum/-/message_boards/view_message/255207

The short of it is, use CachingLocalProvider implementations not the plain LocalProvider …

I`m using CachingBatchableLocalEntityProvider, not LocalProvider…

The best advice I have then is to enable quey logging in the database you use. ( this goes for the original poster too ).

And analyze the queries, look for table-scans ( ie when it is missing index / using index for order rather than selection etc… )