java - Large table and SQL between operator: performance issue with Spring Data -


I am using spring data at the top of hibernation. I have intangible class A and some implementations, two of which are linked to a large number of records in the database, suppose that 200k I am using a TABLE_PER_CLASS legacy strategy, there are links to the second class of Class A, in which two There are two numbers, D1 and D2. Now, I want to execute a question like findByCD1BetweenAndCD2Between (double minD1, double maxD1, double minD2, double maxD2):

  @Repository Public Interface Arepository extends JpaRepository & lt; A, long>, JpaSpecificationExecutor & lt; A & gt; {FindByCD1BetweenAndCD2Between (double minD1, double maxD1, double minD2, double maxD2):}  

My class C is embedded and an index is defined:

  @ Entity @Configurable @Embeddable @Table (index = {@ index (columnist = "D1, D2")}) Public category C {Private double D1; Private double d2:}  

Class A embeds it:

  @Entity @Inheritance (strategy = InheritanceType.TABLE_PER_CLASS) @Configurable public class C { @Embedded Private Coordinates Index; /*...*/}  

When I do this, the query actually takes several minutes. Executing the query directly in SQL does not take long because it's a matter of seconds. The number of condition matching records is in the order of 100. How can I customize this situation in order to decrease the calculation for a few seconds?


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -