Re: [GENERAL] Getting value of SERIAL column after insert from libpq?

From: Howie <caffeine(at)toodarkpark(dot)org>
To: Mark Alliban <MarkA(at)idnltd(dot)com>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Getting value of SERIAL column after insert from libpq?
Date: 1999-12-22 18:55:42
Message-ID: Pine.LNX.3.96.991222184042.25654Z-100000@rabies.toodarkpark.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 22 Dec 1999, Mark Alliban wrote:

> Thanks for the help, it works great!
>
> However, there is a problem with performance.
> I am moving from MySQL to Postgres, and to test performance I am inserting a
> large row (30 fields) into a table from my C program. I am running this
> program 50 times, and timing the results. The MySQL version of the program
> took 0.75 seconds to execute 50 times, but the Postgres version takes 22-25
> seconds.

yeouch, that doesnt sound normal... especially seeing that ive been
inserting ~100 rows, doing a convert, cp'ing a file, _and_ checking for
referential integrity in ~40-45 seconds... and the app has the normal perl
overhead.

make sure you've turned fsync off ( -F opt to postmaster iirc ).

> A similar test with a simple select takes 3.5 seconds on Postgres
> but 0.8 on MySQL. Postgres undoubtably has more features and is better for
> my app than MySQL, but are these performance values normal?

depends on the select. if its not hitting indexes ( doing a full table
scan ), things get slow. try doing an explain of the query and make sure
you have indexes on most (if not all) of the columns in the WHERE clause.

> [SNIP]

---
Howie <caffeine(at)toodarkpark(dot)org> URL: http://www.toodarkpark.org
"I've learned that you cannot make someone love you.
All you can do is stalk them and hope they panic and give in."

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 1999-12-22 19:36:37 Re: [GENERAL] Interbase replacement
Previous Message Robert W. Berger 1999-12-22 18:52:24 Re: [GENERAL] Interbase replacement