mysql - Hibernate performance tuning for multiple similar select queries -


The problem I have is that I have a lot of questions in the batch:

  records Select ID, A, B, C from where select A, A, B, C from A = 1 and B = 2 records where A = 5 and B = 3 ID, A, B, C. Select = 2 and select ID, A, B, C from B = 5 archives where one = 3 and B = 4 ...   

Generally 1000 in a batch There are queries, which end approximately 0.5, a and B sequence With injury. Auto commute is on and all connections are managed in the bonecp connection pool. The use of hibernate is used to map each result to an object in an intensification.

My questions are: 1. 1. Does this make a difference if I add them in the same question, even then all DB connections remain and need to wait for connection to set up service is not?
2. If yes, what is the best practice to do in hibernation?
3. If not, then I want to make a difference in executing it all the questions in concurrent (rather than one instead of the one in the current case), although the connection pool only executes a certain number at the same time allows for?

Fade retrieves to load related organizations (batch, join, asaballed) Strategies are provided, but for HQL / JPPL you can generate the best query that you did with a basic query.

  1. You have to disable auto-commit; it is not playing hibernate well-playing with the rear transaction and it also interferes with the display.

  2. Since you are using MySQL, you can try to create one like this:

      from the record ID, A , B, C, where (A, B) IN ((1, 2), (5, 3), (2, 5), (3, 4))    
  3. If you are not interested in fetching entities (to update / delete them) and you only need projection (ID, A, B, C), then a basic query is from an HQL Good choice (MySQLDialkct also supports this syntax ).

  4. I do not execute those concurrently, the CP lock dispute is going to be your next hurdle and only a single in query for index-scan will perform better than many smaller ones.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -