Re: temporary indexes? - Mailing list pgsql-general

From Jonathan Vanasco
Subject Re: temporary indexes?
Date
Msg-id 8F7D0E78-C82C-49C2-B5EE-D87DD1934E25@2xlp.com
Whole thread Raw
In response to Re: temporary indexes?  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List pgsql-general
On Oct 22, 2015, at 5:04 PM, Jim Nasby wrote:

>
> What % of execution time is spent creating those indexes? Or is that factored into the 1000%? Also, could your
analysisqueries be run in a REPEATABLE READ transaction (meaning that once the transaction starts it doesn't get any
newdata)? If it could then the temp indexes could be static, which would mean no update overhead. 

Running without the indexes would take over an hour to execute the scripts, and totally jams the machine (we got
30minutesin once, and had to kill it).  That's because of millions of rows used in joins and sequential scans.   

Building all the indexes takes 30 seconds; most SQL commands then run only against the indexes (some of which are
partial)and the entire suite finishes in about 3 minutes. 

If the indexes stay active during the day, there seems to be a 2-3% drop in write performance.   This is on a webapp,
sowe're just happier shifting the index work from peak hours to offpeak hours.  It means we can delay spinning up
anotherapplication server a bit longer. 

I'll definitely look into your suggestions the next time I hit this code.

pgsql-general by date:

Previous
From: Dane Foster
Date:
Subject: Re: A question about PL/pgSQL DECLAREd variable behavior
Next
From: Thomas Munro
Date:
Subject: Re: A question about PL/pgSQL DECLAREd variable behavior