pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rod Taylor <rbt@rbt.ca>
To: john@pagakis.com
Cc: Postgresql Performance <pgsql-performance@postgresql.org>
Subject: Re: Performance Concern
Date: Fri, 24 Oct 2003 14:22:42 -0400
Message-ID: <1067019762.81651.64.camel@jester> (raw)
In-Reply-To: <KKEBKDPPLALEFHBEAOCCGEBLDEAA.john@pagakis.com>
References: <KKEBKDPPLALEFHBEAOCCGEBLDEAA.john@pagakis.com>

On Thu, 2003-10-23 at 08:21, John Pagakis wrote:
> Greetings.
> 
> I have a table that will require 100,000 rows initially.
> 
> Assume the following (some of the field names have been changed for
> confidentiality reasons):
> 
> CREATE TABLE baz (
>     baz_number CHAR(15) NOT NULL,
>     customer_id CHAR(39),
>     foobar_id INTEGER,
>     is_cancelled BOOL DEFAULT false NOT NULL,
>     create_user VARCHAR(60) NOT NULL,
>     create_datetime TIMESTAMP DEFAULT 'now()' NOT NULL,
>     last_update_user VARCHAR(60) NOT NULL,
>     last_update_datetime TIMESTAMP DEFAULT 'now()' NOT NULL,
>     CONSTRAINT PK_baz PRIMARY KEY (baz_number)
> );
> 
> ALTER TABLE baz
>     ADD FOREIGN KEY (customer_id) REFERENCES purchase (customer_id);
> 
> ALTER TABLE baz
>     ADD FOREIGN KEY (foobar_id) REFERENCES foobar (foobar_id);
> 
> 
> Using JDBC, it took approximately one hour to insert 100,000 records.  I
> have an algorithm to generate a unique baz_number - it is a mixture of alpha
> and numerics.

Using an int for identification is certainly suggested, however it
sounds like you may be short a few indexes on the foreign key'd fields.

EXPLAIN ANALYZE output is always nice..

Attachments:

  signature.asc (application/pgp-signature, 186B) download

view thread (16+ messages)  latest in thread

Message-ID: <1067019762.81651.64.camel@jester>
Permalink:  ../1067019762.81651.64.camel@jester/
Also on:    postgresql.org/message-id/1067019762.81651.64.camel@jester

 · 

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: rbt@rbt.ca, john@pagakis.com
  Subject: Re: Performance Concern
  In-Reply-To: <1067019762.81651.64.camel@jester>
  References: <KKEBKDPPLALEFHBEAOCCGEBLDEAA.john@pagakis.com> <1067019762.81651.64.camel@jester>

* 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