the data is coming from text files which are fed into a table on oracle using sql loader.
the last column on this table is an errorcode which on loading is null for every record.
i then run a validate script which then checks each row to make sure it conforms to specification.
this particular file has around 50 columns whihc have to validated in one way or another - the example i gave was much simplified than the actual script.
If it's true that you don't have to do anything else with this table (which honestly seems really doubtful -- what's the point of loading the data, identifying errors, then never looking for them or using the data again) then you don't need to analyze it.
there is a separate "insert" script which then puts the validated data onto the actual tables required, but this question is based purely around the validation part.
thanks for your answer, it's what i thought as well.
just had a thought - what if the script was stopped after updating 4 million rows, and an analyze was run? the errorcode would be updated for a lot of records and wouldn't the initial select speed up?
If you mean that the error code would be updated by the first run for half the rows, and those rows that had an error code could then be ignored when the script was rerun, then i don't think it would make a difference.
In the absence of indexes a full scan would have to be performed anyway. You could add an index to the error code column, but even if the table was analyzed the cost-based optimizer ought to ignore it.
Does each row get updated with a code, whether or not an error is found? If so, what proportion of the rows do not generally have an error?
Bookmarks