Matt Doran <[EMAIL PROTECTED]> writes: > That did it!!! From 22 minutes down to less than a second. :) > > I'm kinda embarassed that I didn't figure it myself.
Don't be. It is not obvious. > I had not idea > that derby didn't keep any stats up-to-date without performing that > operation explicitly. Ideally it would keep this up-to-date itself. > The sys.sysstatistics didn't have any rows in it until I ran the > compress table operation. Agreed, but strangely I cannot recall many users actually requesting this. Maybe people just suffer silently? Anyway, thank you for what I would call an exemplary bug-report/question! Even though you use Hibernate you took the time to identfy the actual SQL causing the problem, identified a minimal repro and provided query plans. > It really needs to be made more prominent in the documentation. > i.e. once your database is loaded with representative data, perform > the compress op for optimal performance. Agreed. Any thoughts on where it would be good to mention it? If you want, you can file a Jira issue about this. > In the mean-time, we've added a maintenance task to our application to > do this operation periodically. -- dt
