On Friday, May 20, 2016 at 7:24:16 PM UTC+2, Brett Ryan wrote: > > I have a real world use for needing to optimise either paginated or full > select queries. > > I'm presently using H2 as a transport database. What I'm doing is > exporting data from database to an h2 database, copying the exported data > to another machine then using that database to load the data back in on > that machine. This method has been found to be very effective for smaller > tables, though I'm presently facing a problem with a table that's just shy > of 40 million rows. I've got the db built fine, though doing a select > without a where clause just borks, as does any paginating with limit/offset. > > 40 milion is actually conservative as I've only taken a sample size, if I > were to process everything this would end up being several billion rows. > > If you're wondering what the data is it's retail barcode scans. >
Don't use OFFSET for that. Use an ordering on an indexed column (pk will do fine) in combination with LIMIT. In fact, NEVER use OFFSET, it is a non-feature. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
