Re: [GENERAL] Noticed something odd with pgbench

2012-11-16 Thread Steven Schlansker
On Nov 16, 2012, at 11:59 AM, Richard Huxton wrote: > On 16/11/12 19:35, Shaun Thomas wrote: >> Hey guys, >> >> So, we have a pretty beefy system that runs dual X5675's with 72GB of RAM. >> After our recent upgrade to 9.1, things have been... odd. I managed to track >> it down to one setting:

Re: [GENERAL] Noticed something odd with pgbench

2012-11-16 Thread Shaun Thomas
On 11/16/2012 01:59 PM, Richard Huxton wrote: http://frosty-postgres.blogspot.co.uk/2012/08/postgresql-numa-and-zone-reclaim-mode.html I actually considered zone_reclaim_mode. But the article you linked to misses a point: during boot, zone_reclaim_mode is chosen only if the zone distance is

Re: [GENERAL] Noticed something odd with pgbench

2012-11-16 Thread Richard Huxton
On 16/11/12 19:35, Shaun Thomas wrote: Hey guys, So, we have a pretty beefy system that runs dual X5675's with 72GB of RAM. After our recent upgrade to 9.1, things have been... odd. I managed to track it down to one setting: shared_buffers = 8GB It does the same thing at 6GB. 4GB is safe

[GENERAL] Noticed something odd with pgbench

2012-11-16 Thread Shaun Thomas
Hey guys, So, we have a pretty beefy system that runs dual X5675's with 72GB of RAM. After our recent upgrade to 9.1, things have been... odd. I managed to track it down to one setting: shared_buffers = 8GB The thing is, we currently have 850 clients connected to our database (I know, that'

Re: [GENERAL] Full text search ranking: ordering using index and proximiti ranking with OR queries

2012-11-16 Thread Merlin Moncure
On Wed, Mar 7, 2012 at 11:59 AM, Andrey Chursin wrote: > Is there any way to sort by ranking, avoiding seq scan? > The only way i see now is to use pg_trgm instead of ts_rank, but we > did not check yet how applicable is it for our purposes. pg_tgrm works very well in terms of measuring similarit

Re: [GENERAL] FATAL: index contains unexpected zero page at block

2012-11-16 Thread Dmitriy Tyugaev
Thanks for the reply! Help me please how to use the pg_resetxlog? I read the documentation http://www.postgresql.org/docs/8.4/static/app-pgresetxlog.html, but did not fully understand how to use it. There are many of values... $ ./pg_resetxlog -n /opt/postgresql/data pg_control values: First log

[GENERAL] PostgreSQL logging - restrict error messages

2012-11-16 Thread hartrc
I'm running PostgreSQL 9.1.6 on Linux SLES 11 SP2 My question is, is it possible to restrict entries into the log bases on number of entries per second or avoid duplicate entries within the same second? Some background: My non default logging parameters in postgresql.conf #LOGGING log_directory

Re: [GENERAL] High SYS CPU - need advise

2012-11-16 Thread Jeff Janes
On Fri, Nov 16, 2012 at 8:21 AM, Merlin Moncure wrote: > On Fri, Nov 16, 2012 at 9:52 AM, Vlad wrote: >> >>> *) failing that, LWLOCK_STATS macro can be compiled in to give us some >>> information about the particular lock(s) we're binding on. Hopefully >>> it's a lwlock -- this will make diagnos

Re: [GENERAL] Check table storage parameters

2012-11-16 Thread Lee Hachadoorian
> On Fri, Nov 16, 2012 at 10:11 AM, Lee Hachadoorian > wrote: >> >> How can I read the current storage parameters for an existing table? >> Specifically interested in autovacuum_enabled. On Fri, Nov 16, 2012 at 12:08 PM, Mike Blackwell wrote: > Try pg_class.reloptions? That was it. Interesting

Re: [GENERAL] Full text search ranking: ordering using index and proximiti ranking with OR queries

2012-11-16 Thread Nicolas Grilly
There is some good news coming from Oleg Bartunov and Alexander Korotkov about improving ranking speed: http://wiki.postgresql.org/images/2/25/Full-text_search_in_PostgreSQL_in_milliseconds-extended-version.pdf It's worth reading their slides to gain a better understanding of PostgreSQL fulltext i

[GENERAL] user aggregate function ( calculate the average value of each index of an array column )

2012-11-16 Thread Myoung-Ah KANG
Hi, I have a table with several lines as following; - Create table mytable (type number , values integer [2]) ; - Insert into mytable values (1, '{ 10, 0 }' ); - Insert into mytable values (1, '{ 20, 30 }' ); - Insert into mytable values (2, '

Re: [GENERAL] High SYS CPU - need advise

2012-11-16 Thread Vlad
> We're looking for spikes in 'blk' which represents when lwlocks bump. > If you're not seeing any then this is suggesting a buffer pin related > issue -- this is also supported by the fact that raising shared > buffers didn't help. If you're not seeing 'bk's, go ahead and > disable the stats mac

Re: [GENERAL] Check table storage parameters

2012-11-16 Thread Mike Blackwell
Try pg_class.reloptions? __ *Mike Blackwell | Technical Analyst, Distribution Services/Rollout Management | RR Donnelley* 1750 Wallace Ave | St Charles, IL 60174-3401 Office: 630.313.7818 mike.blackw...@rrd.com http://

Re: [GENERAL] High SYS CPU - need advise

2012-11-16 Thread Merlin Moncure
On Fri, Nov 16, 2012 at 9:52 AM, Vlad wrote: > Merlin, > > >> Yeah -- you're right, this is definitely spinlock issue. Next steps: >> >> *) in mostly read workloads, we have a couple of known frequent >> offenders. In particular the 'BufFreelistLock'. One way we can >> influence that guy is to

Re: [GENERAL] FATAL: index contains unexpected zero page at block

2012-11-16 Thread Dmitriy Tyugaev
How can I execute rebulding the index, if it does not start and I can't connect? On Thu, Nov 15, 2012 at 2:34 AM, VB N wrote: > > user=,db= FATAL: index "316879235" contains unexpected zero page at block >> 264 >> user=,db= HINT: Please REINDEX it. >> >> Please tell me what can I do to recover

[GENERAL] PG_TERMINATE_BACKEND not working.

2012-11-16 Thread Harry
I am facing problem i.e. connections after execution completed are residing in pg_stat_activity and pg_stat_database. but when i am trying to kill them manually using pg_terminate_backend (All IDLE connections are getting killed but, others like declare, select etc.) are not getting killed getting

[GENERAL] Check table storage parameters

2012-11-16 Thread Lee Hachadoorian
How can I read the current storage parameters for an existing table? Specifically interested in autovacuum_enabled. Sorry to ask such basic question, but I can't find this in the docs, and every search I've tried ends up taking me to how to *set* the parameter with CREATE TABLE and ALTER TABLE. T

Re: [GENERAL] High SYS CPU - need advise

2012-11-16 Thread Vlad
Merlin, Yeah -- you're right, this is definitely spinlock issue. Next steps: *) in mostly read workloads, we have a couple of known frequent offenders. In particular the 'BufFreelistLock'. One way we can influence that guy is to try and significantly lower/raise shared buffers. So this is o

Re: [GENERAL] Set returning functions in the SELECT list

2012-11-16 Thread Tom Lane
Ryan Kelly writes: > I have a question about the behavior of SRFs in the SELECT list. If you have more than one in a select list, the number of resulting rows is the least common multiple of their periods, because the select list gets cycled until they all terminate at the same time. > Also, I'm

Re: [GENERAL] High SYS CPU - need advise

2012-11-16 Thread Merlin Moncure
On Thu, Nov 15, 2012 at 6:07 PM, Jeff Janes wrote: > On Thu, Nov 15, 2012 at 2:44 PM, Merlin Moncure wrote: > select(0, NULL, NULL, NULL, {0, 1000}) = 0 (Timeout) select(0, NULL, NULL, NULL, {0, 1000}) = 0 (Timeout) select(0, NULL, NULL, NULL, {0, 1000}) = 0 (Timeout) selec

[GENERAL] Set returning functions in the SELECT list

2012-11-16 Thread Ryan Kelly
I have a question about the behavior of SRFs in the SELECT list. Consider the following example: select generate_series(1,2), generate_series(1,2) ; And its output: generate_series | generate_series -+- 1 | 1 2

Re: [GENERAL] Aggeregate funtion calculating the average value of each same index of an array column in a table

2012-11-16 Thread David Johnston
On Nov 16, 2012, at 3:52, LEA KANG wrote: > Hi, > > I have a table with several lines as following; > > -Create table mytable (type number , values integer [2]) ; > > -Insert into mytable values (1, ‘{ 10, 0 }’ ); > -Insert into mytable values (1, ‘{ 20, 30 }’ ); > -Insert

Re: [GENERAL] Pg/SQL returning composite type

2012-11-16 Thread Raymond O'Donnell
On 16/11/2012 09:46, P. Broennimann wrote: > Hi there > > I have in schema "core": > >CREATE OR REPLACE FUNCTION core.f_read >( > ... >) >RETURNS core.c_result_type AS >$$ >declare > c_result core.c_result_type%rowtype; >begin > ... > return c_resul

[GENERAL] Pg/SQL returning composite type

2012-11-16 Thread P. Broennimann
Hi there I have in schema "core": CREATE OR REPLACE FUNCTION core.f_read ( ... ) RETURNS core.c_result_type AS $$ declare c_result core.c_result_type%rowtype; begin ... return c_result; end ... CREATE TYPE core.c_result_type AS ( a_value

Re: [GENERAL] Plproxy with returns table() make PG segfault

2012-11-16 Thread Sébastien Lardière
On 11/15/2012 08:40 PM, Cédric Villemain wrote: > top post: this looks like a plproxy bug (no ?), I've added Marko in CC. Yes, it is, i think … > > >> I've a segfault on a PostgreSQL 9.1 cluster, with a plproxy function >> call. Both PostgreSQL and plproxy are up to date. I use SQL/MED in that >

[GENERAL] Aggeregate funtion calculating the average value of each same index of an array column in a table

2012-11-16 Thread LEA KANG
Hi, I have a table with several lines as following; - Create table mytable (type number , values integer [2]) ; - Insert into mytable values (1, ‘{ 10, 0 }’ ); - Insert into mytable values (1, ‘{ 20, 30 }’ ); - Insert into mytable values (2, ‘{30, 60}’ ); (In fact