Locking stats at 0 rows on table improves performance
Hi All,
We have a table(JOBDATA) for which data is populated dynamically as part of application(J2EE + JDBC) execution. Table is always present in DB, however rows are populated at the start of the job run and deleted after the job completes. The no.of rows in table keeps varying depending on the Job Run. If we gather stats on the table before process run it is considering 0 rows and performance is decreasing significantly. As job run in a nightly batch we cannot gather stats on the table when the table is completely populated.
However we have observed that truncating the table and gathering, locking stats has improved the performance of the job. I want to understand why this is improving the performance. Is there any better way to do this?