Re: Long running INSERT+SELECT query - Mailing list pgsql-general

From Steven Lembark
Subject Re: Long running INSERT+SELECT query
Date
Msg-id 20180427145041.031abeda.lembark@wrkhors.com
Whole thread Raw
In response to Re: Long running INSERT+SELECT query  (Vitaliy Garnashevich <vgarnashevich@gmail.com>)
Responses Re: Long running INSERT+SELECT query  (Tim Cross <theophilusx@gmail.com>)
List pgsql-general
On Fri, 27 Apr 2018 19:38:15 +0300
Vitaliy Garnashevich <vgarnashevich@gmail.com> wrote:

> We're going to try using "SELECT 1 FROM table FOR KEY SHARE" for each of 
> the tables, which are referenced by results, before running the big 
> query. That should be up to a million of rows in total. It will probably 
> not cover the case when a record is INSERT'ed and then DELETE'd after 
> the calculation has begun, but such cases should be even more rare than 
> the DELETE's we're currently facing.

Thing about using a couple of Materialized Views for the worst 
part of it.


-- 
Steven Lembark                                         1505 National Ave
Workhorse Computing                                   Rockford, IL 61103
lembark@wrkhors.com                                      +1 888 359 3508


pgsql-general by date:

Previous
From: Andres Freund
Date:
Subject: Re: Can PostgreSQL create new WAL files instead of reusing old ones?
Next
From: Adam Tauno Williams
Date:
Subject: Re: Asynchronous Trigger?