1 Reply Latest reply on May 22, 2002 10:51 AM by Dain Sundstrom

    some thoughts about read ahead

    Tim Fox Master

      The current read ahead strategy on jboss cmp has a page size setting which determines the max. no rows to return in a read ahead query.

      Sometimes it seems much more desirable to return ALL the rows. For instance when you KNOW that there will be no problem in fitting them in memory.

      The current read ahead query seems looks something like:

      select from table where id = ? or id = ? or id = ?

      It's very hard to optimize queries like this for performance, since the selected rows can be distributed all over the table.

      My gut feeling is that queries like this would tend to produce table scans which can be crippling on large tables.

      Moreover, if all rows were returned, the original query could be executed directly resulting in much better performance.

      I know this is early days, and I believe more read-ahead strategies are going to be implemented eventually, but is a "read-all" strategy like the above going to be one of them?

        • 1. Re: some thoughts about read ahead
          Dain Sundstrom Master

          We have this. It is called read-ahead on-find, meaning that extra columns are loaded on-find. The default is on-load block loading.

          I think there is a bug in the current metadata code where it ignores strategy setting, so you will have to wait a few days before you can test it; I'm writing the sample code for the optimized-loading chapter today.