Gathering Stats When Loading Data

by Granville Bonyata on September 7, 2017

Introduced in 12c, in some situations we can gather stats online when the data is loaded without taking any extra time:

1) When doing a direct path load (the APPEND or PARALLEL hint uses direct path loads)
2) The table is empty before the load.

If both those are true, use the hint GATHER_OPTIMIZER_STATISTICS and your insert statement will also gather statistics, at virtually no cost.

This doesn’t set index statistics, so if your table has any indexes, you can gather those separately and gathering index stats is still MUCH faster than collecting table statistics.

Previous post:

Next post: