Re: [PERFORM] multiple threads inserting into the same table

2009-03-23 Thread Tom Lane
Brian Cox writes: > This is a java app. A thread dump reveals that these 5 threads are all > asleep on a socket read to postgres (see below). It seems clear that what you've got isn't a performance problem. May I suggest taking it to pgsql-jdbc? The folk there are more likely to be able to help

Re: [PERFORM] multiple threads inserting into the same table

2009-03-23 Thread Tom Lane
Scott Marlowe writes: > On Mon, Mar 23, 2009 at 2:25 PM, Brian Cox wrote: >> This generates and executes a single SQL insert. Since, as you point out, >> postgres seems to think that this transaction isn't doing anything, >> it's hard to figure out what the read is doing. > Might you have a fire

Re: [PERFORM] multiple threads inserting into the same table

2009-03-23 Thread Brian Cox
David Wilson [david.t.wil...@gmail.com] wrote: How many indexes are there on ts_stats_transset_user_daily? 10: create index ts_stats_transet_user_daily_DayIndex on ts_stats_transet_user_daily (ts_day); create index ts_stats_transet_user_daily_HourIndex on ts_stats_transet_user_daily (ts_hour)

Re: [PERFORM] multiple threads inserting into the same table

2009-03-23 Thread Brian Cox
Scott Marlowe [scott.marl...@gmail.com] wrote: Might you have a firewall that's killing the connections? What does netstat -an on the client side say about these connections? I don't think so: 1) app and postgres are on the same machine and 2) this has been the set up for months and I don't thi

Re: [PERFORM] multiple threads inserting into the same table

2009-03-23 Thread Scott Marlowe
On Mon, Mar 23, 2009 at 2:25 PM, Brian Cox wrote: > Tom Lane [...@sss.pgh.pa.us] wrote: >> >> pg_stat_activity says those five threads are doing nothing except >> sitting around with open transactions.  You sure you don't have a bug on >> the application side? >> >>                        regards,

Re: [PERFORM] multiple threads inserting into the same table

2009-03-23 Thread Brian Cox
Tom Lane [...@sss.pgh.pa.us] wrote: pg_stat_activity says those five threads are doing nothing except sitting around with open transactions. You sure you don't have a bug on the application side? regards, tom lane This is a java app. A thread dump reveals that these 5

Re: [PERFORM] multiple threads inserting into the same table

2009-03-23 Thread Tom Lane
Brian Cox writes: > The application log shows that 99652 rows are being inserted into > relation ts_stats_transet_user_daily. 5 threads are doing the inserts. pg_stat_activity says those five threads are doing nothing except sitting around with open transactions. You sure you don't have a bug

Re: [PERFORM] multiple threads inserting into the same table

2009-03-23 Thread David Wilson
On Mon, Mar 23, 2009 at 3:34 PM, Brian Cox wrote: > The application log shows that 99652 rows are being inserted into relation > ts_stats_transet_user_daily. 5 threads are doing the inserts. The schema is > lengthy, but it has a synthetic primary key (ts_id int8 not null) and the > following const

[PERFORM] multiple threads inserting into the same table

2009-03-23 Thread Brian Cox
The application log shows that 99652 rows are being inserted into relation ts_stats_transet_user_daily. 5 threads are doing the inserts. The schema is lengthy, but it has a synthetic primary key (ts_id int8 not null) and the following constraints: alter table ts_stats_transet_user_daily add co