Basically, I want to do effective and fast lazy loading sorted list on a web page with HSQLDB. My current SQL query ineffective and slow:
基本上,我想在使用HSQLDB的网页上进行有效且快速的延迟加载排序列表。我当前的SQL查询无效且缓慢:
SELECT o FROM Human AS o ORDER BY o.firstName ASC LIMIT 500k OFFSET 50;
Could I increase performance of it?
我可以提高它的性能吗?
Domain Object:
域对象:
@RooJpaActiveRecord
public class Human {
@NotNull
@Column(name="firstName")
String firstName;
@NotNull
@Column(name="lastName")
String lastName;
}
SQL table:
SQL表:
Id, firstName, lastName, Version
1 个解决方案
#1
0
Add an index on the firstName
column and you are ready to go (if you are gonna sort only/first by firstName). Of course this depends on your database. For MySQL see this page.
在firstName列上添加一个索引,您就可以开始了(如果您只按firstName排序/第一个)。当然这取决于您的数据库。对于MySQL,请参阅此页面。
#1
0
Add an index on the firstName
column and you are ready to go (if you are gonna sort only/first by firstName). Of course this depends on your database. For MySQL see this page.
在firstName列上添加一个索引,您就可以开始了(如果您只按firstName排序/第一个)。当然这取决于您的数据库。对于MySQL,请参阅此页面。