Re: Why is PostgreSQL 9.2 slower than 9.1 in my tests?
От | Jeff Janes |
---|---|
Тема | Re: Why is PostgreSQL 9.2 slower than 9.1 in my tests? |
Дата | |
Msg-id | CAMkU=1zcAGKqt36frn8zTytJvta82cM1LAVf2Z0iPfjHLra_Tg@mail.gmail.com обсуждение исходный текст |
Ответ на | Why is PostgreSQL 9.2 slower than 9.1 in my tests? (Patryk Sidzina <patryk.sidzina@gmail.com>) |
Ответы |
Re: Why is PostgreSQL 9.2 slower than 9.1 in my tests?
|
Список | pgsql-performance |
On Wed, Dec 5, 2012 at 4:09 AM, Patryk Sidzina <patryk.sidzina@gmail.com> wrote: > > CREATE TEMP TABLE test_table_md_speed(id serial primary key, n integer); > > CREATE OR REPLACE FUNCTION TEST_DB_SPEED(cnt integer) RETURNS text AS $$ > DECLARE > time_start timestamp; > time_stop timestamp; > time_total interval; > BEGIN > time_start := cast(timeofday() AS TIMESTAMP); > FOR i IN 1..cnt LOOP > INSERT INTO test_table_md_speed(n) VALUES (i); > END LOOP; > time_stop := cast(timeofday() AS TIMESTAMP); > time_total := time_stop-time_start; > > RETURN extract (milliseconds from time_total); > END; > $$ LANGUAGE plpgsql; > > > SELECT test_db_speed(1000000); > > I see strange results. For PostgreSQL 9.1.5 I get "8254.769", and for 9.2.1 > I get: "9022.219". This means that new version is slower. I cannot find why. > > Any ideas why those results differ? Did you just run it once each? The run-to-run variability in timing can be substantial. I put the above into a custom file for "pgbench -f sidzina.sql -t 1 -p $port" and run it on both versions in random order for several hundred iterations. There was no detectable difference in timing. Cheers, Jeff
В списке pgsql-performance по дате отправления: