On 8/8/2013 6:19 PM, Katherine Marsden wrote:
On 8/8/2013 3:13 PM, Jasmeet Bhatia (jasmbhat) wrote:
I have in-memory 10.7.1.1 derby.
I am trying to verify if indexes are being used in my query. But I
notice that there are no statistics in the sys statistics table. Any
ideas what is going on?
Jasmeet Bhatia
With 10.8 statistics update is automatic.
do note for the "automatic" to kick in you need to do a query on the
table and then they will show up later. So if you load your db from
scratch for testing and look there may be no stats initially. If you
are able to control the order in your application it is best to
load data first and then create indexes and primary keys. Then the
stats are automatically created as part of creating the supporting
indexes. And will be there for your initial query.
Of course this does not work if your app needs to start with empty
tables and data comes in later.
With 10.7 you can create/update statistics with the
SYSCS_UTIL.SYSCS_UPDATE_STATISTICS system procedure:
http://db.apache.org/derby/docs/10.7/ref/rrefupdatestatsproc.html
or by compressing the tables:
http://db.apache.org/derby/docs/10.7/ref/rrefaltertablecompress.html
Thanks
Kathey