sql - Increase performance of SELECT * FROM # ORDER BY # ASC LIMIT # OFFSET #; -


basically, want effective , fast lazy loading sorted list on web page hsqldb. current sql query ineffective , slow:

select o human o order o.firstname asc limit 500k offset 50; 

could increase performance of it?

domain object:

@roojpaactiverecord public class human {     @notnull     @column(name="firstname")     string firstname;      @notnull     @column(name="lastname")     string lastname; } 

sql table:

id, firstname, lastname, version 

add index on firstname column , ready go (if gonna sort only/first firstname). of course depends on database. mysql see this page.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -