MailArchive Performance Improvement – Works on Oracle

I used Oracle for the first time in my life today – thanks to help from David Haines – it was not nearly as scary as I had imagined. David told me about henplus – which is the “vi” of database debugging tools – fits my style perfectly.
He walked me through my properties and getting connected to the database. Once connected – it felt a lot like any other database. Hey – put semicolons at the end.
The MailArchive paging code came together in three compiles. Here are some cool queries.
select * from ( select a.*, rownum rnum from ( select XML from MAILARCHIVE_MESSAGE where (CHANNEL_ID = ? ) order by MESSAGE_DATE desc ) a where rownum <= 20 ) where rnum >= 11
Note that the rows start from 1 – unlike the LIMIT in HSQL or MySql – where the rows start from zero. But all in all pretty straightforward.