hhmx.de

Föderation · So 08.12.2024 01:30:46

Holy heck it just occurred to me. RETURNING is a terrible idea! You always want to query the database, then insert into it. Because if you insert with ON CONFLICT and RETURNING, it has to start a write transaction, and it has to touch the disk, and any caching would get invalidated. I just realized because my webpage thing was grinding the disk loading it, and it's because hundreds of write transaction journal files were being written, then committed, even if the record already existed. I'm going back to insert/select.