On May 7, 1:49 pm, beaTunes Support <[email protected]> wrote: > On May 7, 2009, at 14:23 , Brish wrote: > Anyhow - what I am doing at the moment, is query for id ordered by the > field I would like to have it ordered by and then load individial > pages by id, which is fast enough. Just the original ordered query is > the problem.
I was able to get good performance by creating a temporary table like this: create sequence z; create table t as select next value for z as "ORDINAL", newsgroup_id from (select newsgroup_id, description from newsgroup order by description); create index t_ordinal_index on t(ordinal); select newsgroup.* from t join newsgroup on t.newsgroup_id = newsgroup.newsgroup_id where ordinal between 10000 and 10050; The problem is if the data changes the order can get our of sync with the data in the table so the sorting table needs to have it's order updated. Brish --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/h2-database?hl=en -~----------~----~----~----~------~----~------~--~---
