Yes. This function first performs the INSERT INTO the solardatum.da_datum table that we’re discussing here; then it inserts into two different tables. If it helps, the actual SQL is available here:
It would take me some time to get that change deployed. If I was able to, what information do you think would be helpful here, e.g. that jdata_a is NULL or not, or something else? The duplicate key violation occurs infrequently, and it does seem appropriate to drop the UNIQUE constraint on the da_datum_x_acc_idx given uniqueness is really only wanted on (node_id, ts, source_id). As long as I can confirm that query performance doesn’t decrease, I’d like to recreate the index without UNIQUE. Then I’m hoping this problem, whatever the cause, goes away. — m@ |