firelab / viirs_ba

Python code for burned area estimation using VIIRS scenes.
Creative Commons Zero v1.0 Universal
7 stars 4 forks source link

UPSERT code to eliminate loops in active_fire/threshold_burned? #16

Open bnordgren opened 8 years ago

bnordgren commented 8 years ago

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

bnordgren commented 8 years ago

Loop in viirs_threshold_2_fireevents.sql removed via

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