Re: [PERFORM] how do functions affect query plan?

2014-05-14 Thread changchao
Hi,David Seems that the root of evil is in the function(random,trunc), although I don't know why. Here is the comparison. 1.w/o function : index is wisely used.(Even without the limit 30 clause) explain analyze SELECT md.*   FROM measure_data md   where telegram_id in     ( SELECT  66

Re: [PERFORM] how do functions affect query plan?

2014-05-14 Thread David G Johnston
常超 wrote > Hi,all > I have a table to save received measure data. > > > CREATE TABLE measure_data > ( >   id serial NOT NULL, >   telegram_id integer NOT NULL, >   measure_time timestamp without time zone NOT NULL, >   item_id integer NOT NULL, >   val double precision, >   CONSTRAINT measure_dat

[PERFORM] how do functions affect query plan?

2014-05-14 Thread 常超
Hi,all I have a table to save received measure data. CREATE TABLE measure_data (   id serial NOT NULL,   telegram_id integer NOT NULL,   measure_time timestamp without time zone NOT NULL,   item_id integer NOT NULL,   val double precision,   CONSTRAINT measure_data_pkey PRIMARY KEY (id) ); CREAT

[PERFORM] Stats collector constant I/O

2014-05-14 Thread Craig James
Day and night, the postgres stats collector process runs at about 20 MB/sec output. vmstat shows this: $ vmstat 2 procs ---memory-- ---swap-- -io -system-- cpu r b swpd free buff cache si sobibo in cs us sy id wa 0 0 55864 135740 123804

Re: [PERFORM] CPU spikes and transactions

2014-05-14 Thread Jeff Janes
On Tue, May 13, 2014 at 4:04 PM, Dave Owens wrote: > Hi, > > Apologies for resurrecting this old thread, but it seems like this is > better than starting a new conversation. > > We are now running 9.1.13 and have doubled the CPU and memory. So 2x 16 > Opteron 6276 (32 cores total), and 64GB memo

Re: [PERFORM] CPU spikes and transactions

2014-05-14 Thread Merlin Moncure
On Tue, May 13, 2014 at 6:04 PM, Dave Owens wrote: > Hi, > > Apologies for resurrecting this old thread, but it seems like this is > better than starting a new conversation. > > We are now running 9.1.13 and have doubled the CPU and memory. So 2x 16 > Opteron 6276 (32 cores total), and 64GB memo