firelab / viirs_ba

Python code for burned area estimation using VIIRS scenes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UPSERT code to eliminate loops in active_fire/threshold_burned?

bnordgren opened this issue · comments

Some code may be faster with an "UPSERT" instead of a loop, which is a feature lacking in PostgreSQL 9.4, but is planned for 9.5.

Documentation on how to perform this in 9.4 and earlier is here: http://stackoverflow.com/questions/17267417/how-do-i-do-an-upsert-merge-insert-on-duplicate-update-in-postgresql

Loop in viirs_threshold_2_fireevents.sql removed via

An UPSERT was not necessary here. The active fire inserter may be more difficult.