pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: Medora Schauer <mschauer@fairfield.com>
Cc: postgresql <pgsql-performance@postgresql.org>
Subject: Re: Odd performance results - more info
Date: Tue, 05 Aug 2003 10:41:43 -0700
Message-ID: <3F2FEC57.5010201@joeconway.com> (raw)
In-Reply-To: <906E2C446A276048A1BE283F17BCB12CB137CA@encounter.fairind.fairfield.com>
References: <906E2C446A276048A1BE283F17BCB12CB137CA@encounter.fairind.fairfield.com>

Medora Schauer wrote:
> I would greatly appreciate it if someone could run this code in their
> environment and let me know if you get results similiar to mine.
> The INT test results in execution times of 11 - 50+ secs increasing
> each time the test is run.  The FLOAT test execution times are
> consistently < 3 secs regardless of how many times it is run.

Without actually trying the code, I'd bet that an index is getting used 
for the float8 case, but not in the int8 case:

         if (dtype == INT_TYPE){
             snprintf(buffer, sizeof(buffer),
              "UPDATE shot_record SET trace_count = %d " \
              "WHERE shot_line_num = %d " \
              "  AND shotpoint = %d " \
              "  AND index = %d" ,
              0, shotline, shotpoint + i, 0);
         } else {
             snprintf(buffer, sizeof(buffer),
              "UPDATE shot_record SET trace_count = %d " \
              "WHERE shot_line_num = %f " \
              "  AND shotpoint = %f " \
              "  AND index = %d" ,
              0, (float)shotline, (float)shotpoint + (float)i, 0);
         }

Try running EXPLAIN ANALYZE on these update statements manually. It also 
might help to run VACUUM ANALYZE after populating the tables.

HTH,

Joe




view thread (5+ messages)  latest in thread

Message-ID: <3F2FEC57.5010201@joeconway.com>
Permalink:  ../3F2FEC57.5010201@joeconway.com/
Also on:    postgresql.org/message-id/3F2FEC57.5010201@joeconway.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: mail@joeconway.com, mschauer@fairfield.com
  Subject: Re: Odd performance results - more info
  In-Reply-To: <3F2FEC57.5010201@joeconway.com>
  References: <906E2C446A276048A1BE283F17BCB12CB137CA@encounter.fairind.fairfield.com> <3F2FEC57.5010201@joeconway.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox