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

Поиск
Список
Период
Сортировка
От Howie
Тема Re: [GENERAL] Getting value of SERIAL column after insert from libpq?
Дата
Msg-id Pine.LNX.3.96.991222184042.25654Z-100000@rabies.toodarkpark.org
обсуждение исходный текст
Ответ на Re: [GENERAL] Getting value of SERIAL column after insert from libpq?  ("Mark Alliban" <MarkA@idnltd.com>)
Список 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@toodarkpark.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."


В списке pgsql-general по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [GENERAL] Interbase replacement
Следующее
От: "Robert W. Berger"
Дата:
Сообщение: Re: [GENERAL] Interbase replacement