Re: Postgresql 9.0.2 explain analyze very slow (10x), compared to actual query time

From: Alex Hunsaker <badalex(at)gmail(dot)com>
To: Achilleas Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Postgresql 9.0.2 explain analyze very slow (10x), compared to actual query time
Date: 2011-01-12 19:17:00
Message-ID: AANLkTimpcZxtxcTbc=8RFGj7HF=UKBtkksCFN6ooXGTc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

2011/1/12 Achilleas Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>:

>
> Changed that to smth like: micros_total = micros_total + (double) micros;
> instead of the printf to beat any compiler optimization, and still linux runs at light speed:
> FBSD_TEST : user 0.089s, sys 1.4s
> FBSD_DEV : user 0.183s, sys 3.8s
> LINUX_PROD : user 0.168s, sys 0s
> (regarding that gettimeofday is a syscall in FreeBSD, and that sys time is 0 for linux, makes me think some optimization is being done)

At least on x86_64, linux will use a vsyscall (v for virtual) for
gettimeofday which does not actually need to enter/exit the kernel.
That probably explains a large part of the speed difference here.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Campbell, Lance 2011-01-12 20:35:58 graphical admin tool for RedHat 6
Previous Message Mark Felder 2011-01-12 17:17:28 Re: Postgresql 9.0.2 explain analyze very slow (10x), compared to actual query time