db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: SELECT query takes 5 secs, what can I do?
Date Thu, 17 Sep 2009 09:26:15 GMT
Brett Wooldridge <brett.wooldridge@gmail.com> writes:

> You can force Derby to update statistics with this command:
>
> alter table <table-name> compress [sequential]
>
> Note this command itself might take a long time -- dozens of minutes -- but in
> a system like yours you could get away with running it once or month or so at
> some off-peak time.

In Derby 10.5 you have a cheaper way of updating the index cardinality
statistics. This statement will update the statistics for all the
indexes on columns in MYSCHEMA.MYTABLE without doing an expensive
compress:

  CALL SYSCS_UTIL.SYSCS_UPDATE_STATISTICS('MYSCHEMA', 'MYTABLE', NULL)

http://db.apache.org/derby/docs/10.5/ref/rrefupdatestatsproc.html

-- 
Knut Anders

Mime
View raw message