
|
If you were logged in you would be able to see more operations.
|
|
|
|
File Attachments:
|
|
|
Issue Links:
|
Reference
|
|
|
|
This issue is related to:
|
|
DERBY-1964
Update the documentation of SYSCS_UTIL.SYSCS_COMPRESS_TABLE for the changes that went in as part of DERBY-737
|
|
|
|
|
|
|
| Resolution Date: |
16/Oct/06 09:44 PM
|
There must be an entry in the SYSSTATISTICS table in order for the cardinality statistics in SYSSTATISTICS to be created with SYSCS_UTIL.SYSCS_COMPRESS_TABLE
SYSCS_UTIL.SYSCS_COMPRESS_TABLE should create statistics if they don't exist. The only way to create them if the index was created on an empty table, seems to be to drop and recreate the index after the table has been loaded.
The documentation will also need updating if this change is made.
http://db.apache.org/derby/docs/10.1/tuning/ctunstats57373.html
|
|
Description
|
There must be an entry in the SYSSTATISTICS table in order for the cardinality statistics in SYSSTATISTICS to be created with SYSCS_UTIL.SYSCS_COMPRESS_TABLE
SYSCS_UTIL.SYSCS_COMPRESS_TABLE should create statistics if they don't exist. The only way to create them if the index was created on an empty table, seems to be to drop and recreate the index after the table has been loaded.
The documentation will also need updating if this change is made.
http://db.apache.org/derby/docs/10.1/tuning/ctunstats57373.html |
Show » |
| Repository |
Revision |
Date |
User |
Message |
| ASF |
#464551 |
Mon Oct 16 16:32:50 UTC 2006 |
bpendleton |
DERBY-737: SYSCS_UTIL.SYSCS_COMPRESS_TABLE should create statistics
This patch was contributed by Mamta A. Satoor (msatoor@gmail.com)
The changes have been very localized in
AlterTableConstantAction.java!updateIndex(). Currently, this method checks
if statistics already exist for an index. If yes, then it sets a flag
updateStatistics to true. Later, the code checks for this flag and drops
the existing statistics and creates new statistics for that index provided
the user table at this point is not empty. So, as we can see, if there is
an index with no preexisting statistics, the flag updateStatistics will be
set to false and hence no statistics related code is executed and hence
even though the user table is not empty at the time of compress, no
statistics get generated for such an index.
I am proposing to fix the problem by still using the flag to see if
an index has pre-existing statistics. If yes, then we should drop
those statistics. Next, whether the index has pre-existing statistics or
not, go ahead and create new statistics for the index provided the
user table is not currently empty.
|
| Files Changed |
MODIFY
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/compressTable.sql
MODIFY
/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
MODIFY
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/compressTable.out
MODIFY
/db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/OnlineCompress.java
|
| Repository |
Revision |
Date |
User |
Message |
| ASF |
#632065 |
Thu Feb 28 17:21:33 UTC 2008 |
mamta |
Merging changes for DERBY-737 into 10.1 codeline. The revision being merged is 464551 and
the commit comments for 464551 are as follows
The changes have been very localized in
AlterTableConstantAction.java!updateIndex(). Currently, this method checks
if statistics already exist for an index. If yes, then it sets a flag
updateStatistics to true. Later, the code checks for this flag and drops
the existing statistics and creates new statistics for that index provided
the user table at this point is not empty. So, as we can see, if there is
an index with no preexisting statistics, the flag updateStatistics will be
set to false and hence no statistics related code is executed and hence
even though the user table is not empty at the time of compress, no
statistics get generated for such an index.
I am proposing to fix the problem by still using the flag to see if
an index has pre-existing statistics. If yes, then we should drop
those statistics. Next, whether the index has pre-existing statistics or
not, go ahead and create new statistics for the index provided the
user table is not currently empty.
|
| Files Changed |
MODIFY
/db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/db/OnlineCompress.java
MODIFY
/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/compressTable.sql
MODIFY
/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
MODIFY
/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/compressTable.out
|
|