How To Minimize Likelihood of Database Contention During Update
问题 I have written some PostgreSQL database client code to update a central database with a table of IP addresses and host names from multiple clients. There are two tables: one to hold mappings between IP addresses and host names, and one to hold a queue of IP addresses that have not yet been resolved to host names. Here is the IP-address-to-host-name mapping table: CREATE TABLE g_hostmap( appliance_id INTEGER, ip INET, fqdn TEXT, resolve_time TIMESTAMP, expire_time TIMESTAMP, UNIQUE(appliance