Re: 2x Time difference between first and subsequent run of the same query on fresh established connection (on linux, with perf data included, all query data in the shared buffers) on postgresql 9.3.10. Any explanation? - Mailing list pgsql-general

From Andres Freund
Subject Re: 2x Time difference between first and subsequent run of the same query on fresh established connection (on linux, with perf data included, all query data in the shared buffers) on postgresql 9.3.10. Any explanation?
Date
Msg-id 20160225154903.ci6infz2xrtxzs7h@alap3.anarazel.de
Whole thread Raw
In response to 2x Time difference between first and subsequent run of the same query on fresh established connection (on linux, with perf data included, all query data in the shared buffers) on postgresql 9.3.10. Any explanation?  (Maxim Boguk <maxim.boguk@gmail.com>)
List pgsql-general
Hi,

On 2016-02-25 13:50:11 +1100, Maxim Boguk wrote:
> The first run (something fishy with kernel calls):
>   19,60%  postgres  [kernel.kallsyms]  [k] filemap_map_pages
>   15,86%  postgres  postgres           [.] hash_search_with_hash_value
>    8,20%  postgres  postgres           [.] heap_hot_search_buffer
>    8,20%  postgres  postgres           [.] heap_page_prune_opt
>    5,72%  postgres  postgres           [.] PinBuffer
>    4,38%  postgres  [kernel.kallsyms]  [k] page_fault
>    4,04%  postgres  [kernel.kallsyms]  [k] page_waitqueue
>    3,55%  postgres  [kernel.kallsyms]  [k] __wake_up_bit
>    2,95%  postgres  postgres           [.] LWLockAcquire
>    2,31%  postgres  [kernel.kallsyms]  [k] unlock_page
>    1,96%  postgres  [vdso]             [.] __vdso_gettimeofday
>    1,83%  postgres  [kernel.kallsyms]  [k] radix_tree_next_chunk
>    1,77%  postgres  [kernel.kallsyms]  [k] page_add_file_rmap
>    1,66%  postgres  postgres           [.] _bt_checkkeys
>    1,27%  postgres  postgres           [.] LWLockRelease

Looks like page faults are part of the proble here. Upgrade to 9.4 and
use them unfortunately is the best suggestion I have.

Andres


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: check constraint problem during COPY while pg_upgrade-ing
Next
From: "David G. Johnston"
Date:
Subject: Re: How Restricting user