Add manual ANALYZE after first inserts to a table partition.
Add manual ANALYZE after first inserts to a table partition.

Sometimes it seems that Himan does not find the data it has
calculated just a few minutes earlier. This only occurs when
multiple Himan calls are made. The cause for this is that Himan
searches the database view as_grid_v for data, and that view has a
column record_count which is updated by the database itself. Sometimes
the updating is slow, and Himan has the information that data has not
been calculated at all.

Starting from this commit Himan will execute manual ANALYZE command
if it is inserting to an empty partition. See also ticket STU-6027.

This similar issue has been fixed to grid_to_neons earlier this
year.

fmidev/himan,fmidev/himan,fmidev/himan