Re: [GENERAL] Which process is actually doing the WAL writes/calls XLogFlush?

2017-06-27 Thread Daniel Westermann
AFAIK the wal writer process. ​>Um, no. "Synchronous" means that the caller has to wait for the result to appear before it can move on. "Asynchronous" means that >he caller can issue the instruction and immediately move on. I guessing here but while usually the caller would have to provid

[GENERAL] Re: Unable to understand index only scan as it is not happening for one table while it happens for other

2017-06-27 Thread rajan
thanks for the explanation, Gary. - -- Thanks, Rajan. -- View this message in context: http://www.postgresql-archive.org/Unable-to-understand-index-only-scan-as-it-is-not-happening-for-one-table-while-it-happens-for-other-tp5968835p5968976.html Sent from the PostgreSQL - general mailing lis

Re: [GENERAL] Re: Unable to understand index only scan as it is not happening for one table while it happens for other

2017-06-27 Thread Gary Evans
Hi Rajan, I would say that the optimiser has calculated that it would be quicker to sequentially read thought the table to get the 354 rows returned without the limit. By introducing the limit, it is much faster to pick out the first 10 rows using the index. Using an index is usually only quicke

[GENERAL] Re: Unable to understand index only scan as it is not happening for one table while it happens for other

2017-06-27 Thread rajan
Thanks. Now I did the same query, but it is going for *index-only scan* only after I put *limit* localdb=# explain analyse verbose select uid from mm where uid>100 order by uid; QUERY PLAN -

Re: [GENERAL] postgres: dbname dbuser 9.9.9.9[2222] PARSE waiting

2017-06-27 Thread PT
On Tue, 27 Jun 2017 16:16:53 -0700 (MST) DrakoRod wrote: > Yep, the real problem was all connections are used up. A ps command showed > this: > > postgres 1172 23340 1 13:00 ?00:01:23 postgres: dbsomething > dbsomething 8.8.8.1[34024] PARSE waiting > postgres 1527 23340 3 13:07 ?

Re: [GENERAL] postgres: dbname dbuser 9.9.9.9[2222] PARSE waiting

2017-06-27 Thread Adrian Klaver
On 06/27/2017 04:16 PM, DrakoRod wrote: Yep, the real problem was all connections are used up. A ps command showed this: postgres 1172 23340 1 13:00 ?00:01:23 postgres: dbsomething dbsomething 8.8.8.1[34024] PARSE waiting postgres 1527 23340 3 13:07 ?00:02:47 postgres: dbsome

Re: [GENERAL] Which process is actually doing the WAL writes/calls XLogFlush?

2017-06-27 Thread David G. Johnston
On Tue, Jun 27, 2017 at 3:52 PM, Adrian Klaver wrote: > On 06/27/2017 11:19 AM, Daniel Westermann wrote: > > > > Thanks, Adrian > > It is clear now for the asynchronous stuff and wal_writer. > > But I still did not figure out (or I am just not able to understand it > from the README linked above)

Re: [GENERAL] postgres: dbname dbuser 9.9.9.9[2222] PARSE waiting

2017-06-27 Thread DrakoRod
Yep, the real problem was all connections are used up. A ps command showed this: postgres 1172 23340 1 13:00 ?00:01:23 postgres: dbsomething dbsomething 8.8.8.1[34024] PARSE waiting postgres 1527 23340 3 13:07 ?00:02:47 postgres: dbsomething dbsomething 8.8.8.2[49193] PARSE wai

Re: [GENERAL] postgres: dbname dbuser 9.9.9.9[2222] PARSE waiting

2017-06-27 Thread David G. Johnston
On Tue, Jun 27, 2017 at 3:41 PM, Melvin Davidson wrote: > *His problem is NOT 'idle in transaction' per se. It is all connections > are used up.* > *Hence the need for pg_bouncer for connection pooling.* > > Whether pg_bouncer provides a viable solution is just as big an unknown as whether "idle

Re: [GENERAL] postgres: dbname dbuser 9.9.9.9[2222] PARSE waiting

2017-06-27 Thread Adrian Klaver
On 06/27/2017 03:41 PM, Melvin Davidson wrote: On Tue, Jun 27, 2017 at 6:32 PM, Adrian Klaver *His problem is NOT 'idle in transaction' per se. It is all connections are used up.* Not following. The 'idle in transaction' queries are coming in through a connection so having them around is

Re: [GENERAL] postgres: dbname dbuser 9.9.9.9[2222] PARSE waiting

2017-06-27 Thread PT
On Tue, 27 Jun 2017 18:41:25 -0400 Melvin Davidson wrote: > On Tue, Jun 27, 2017 at 6:32 PM, Adrian Klaver > wrote: > > > On 06/27/2017 01:10 PM, DrakoRod wrote: > > > >> Hi folks. > >> > >> Today I had a problem with production's database PostgreSQL version > >> 9.4.4.9. > >> The server have m

Re: [GENERAL] Which process is actually doing the WAL writes/calls XLogFlush?

2017-06-27 Thread Adrian Klaver
On 06/27/2017 11:19 AM, Daniel Westermann wrote: >>On 06/23/2017 05:50 AM, Daniel Westermann wrote: >>> Hi all, > > Thanks, Adrian > It is clear now for the asynchronous stuff and wal_writer. > But I still did not figure out (or I am just not able to understand it from > the README linked above)

Re: [GENERAL] postgres: dbname dbuser 9.9.9.9[2222] PARSE waiting

2017-06-27 Thread Melvin Davidson
On Tue, Jun 27, 2017 at 6:32 PM, Adrian Klaver wrote: > On 06/27/2017 01:10 PM, DrakoRod wrote: > >> Hi folks. >> >> Today I had a problem with production's database PostgreSQL version >> 9.4.4.9. >> The server have max_connections set to 200, but today I reviewed >> pg_stat_activity and saw 199

Re: [GENERAL] postgres: dbname dbuser 9.9.9.9[2222] PARSE waiting

2017-06-27 Thread Adrian Klaver
On 06/27/2017 01:10 PM, DrakoRod wrote: Hi folks. Today I had a problem with production's database PostgreSQL version 9.4.4.9. The server have max_connections set to 200, but today I reviewed pg_stat_activity and saw 199 active connections, obviously the server rejected any new connection and th

Re: [GENERAL] postgres: dbname dbuser 9.9.9.9[2222] PARSE waiting

2017-06-27 Thread David G. Johnston
On Tue, Jun 27, 2017 at 1:10 PM, DrakoRod wrote: > postgres 9741 23340 9 14:55 ?00:00:47 postgres: dbname user > 8.8.8.8[54286] idle in transaction > > Any suggestions? > ​There is a serious lack of information provided here but "idle in transaction" sessions are generally problematic

Re: [GENERAL] insert on conflict

2017-06-27 Thread armand pirvu
> On Jun 27, 2017, at 3:30 PM, Peter Geoghegan wrote: > > On Tue, Jun 27, 2017 at 12:40 PM, armand pirvu wrote: >> so how is it working in fact ? Isn't it working like looping in the >> IVEE.dim_company and for each company_id if the record does have a >> correspondent in csischema.dim_comp

Re: [GENERAL] insert on conflict

2017-06-27 Thread Peter Geoghegan
On Tue, Jun 27, 2017 at 12:40 PM, armand pirvu wrote: > so how is it working in fact ? Isn't it working like looping in the > IVEE.dim_company and for each company_id if the record does have a > correspondent in csischema.dim_company then update csischema.dim_company set > company_name = EXCLUDED

Re: [GENERAL] postgres: dbname dbuser 9.9.9.9[2222] PARSE waiting

2017-06-27 Thread Melvin Davidson
On Tue, Jun 27, 2017 at 4:10 PM, DrakoRod wrote: > Hi folks. > > Today I had a problem with production's database PostgreSQL version > 9.4.4.9. > The server have max_connections set to 200, but today I reviewed > pg_stat_activity and saw 199 active connections, obviously the server > rejected any

[GENERAL] postgres: dbname dbuser 9.9.9.9[2222] PARSE waiting

2017-06-27 Thread DrakoRod
Hi folks. Today I had a problem with production's database PostgreSQL version 9.4.4.9. The server have max_connections set to 200, but today I reviewed pg_stat_activity and saw 199 active connections, obviously the server rejected any new connection and the production stopped. I saw another posts

[GENERAL] insert on conflict

2017-06-27 Thread armand pirvu
Hi Got question birstdb=# \d csischema.dim_company Table "csischema.dim_company" Column |Type | Modifiers -+-+--- company_id | integer | not null company_name| ch

Re: [GENERAL] Which process is actually doing the WAL writes/calls XLogFlush?

2017-06-27 Thread David G. Johnston
On Tuesday, June 27, 2017, Daniel Westermann < daniel.westerm...@dbi-services.com> wrote: > >On 06/23/2017 05:50 AM, Daniel Westermann wrote: > > But I still did not figure out (or I am just not able to understand it from > the README linked above) > which process is actually doing the write to t

Re: [GENERAL] Which process is actually doing the WAL writes/calls XLogFlush?

2017-06-27 Thread Daniel Westermann
>On 06/23/2017 05:50 AM, Daniel Westermann wrote: >> Hi all, >> >> as I did not find the answer in the documentation: Which background >> process is actually doing the writes/flushes to the WAL? In the docs >> ( https://www.postgresql.org/docs/10/static/wal-configuration.html ) it is >> explain

Re: [GENERAL] Re: Unable to understand index only scan as it is not happening for one table while it happens for other

2017-06-27 Thread Albe Laurenz
rajan wrote: > why the index-only scan *works only* with an *order by*? > localdb=# explain analyse verbose select uid from mm where uid>100 *order > by* uid; > QUERY > PLAN > ---

Re: [GENERAL] Config for fast huge cascaded updates

2017-06-27 Thread Andrew Sullivan
On Mon, Jun 26, 2017 at 07:26:08PM -0700, Joshua D. Drake wrote: > Alternatively, and ONLY do this if you take a backup right before hand, you > can set the table unlogged, make the changes and assuming success, make the > table logged again. That will great increase the write speed and reduce wal

Re: [GENERAL] Accessing DB2 tables from postgresql

2017-06-27 Thread Adrian Klaver
On 06/27/2017 03:11 AM, Swapnil Vaze wrote: Hello, I am trying to access few table present in DB2 LUW from postgres9.5 database. I have installed unixODBC driver and connection to DB2 is working fine. I have installed CartoDB/odbc_fdw foreign data wrappers. I have user below commands to creat

[GENERAL] Re: Unable to understand index only scan as it is not happening for one table while it happens for other

2017-06-27 Thread rajan
Ah! Got it. Thanks. One more question, why the index-only scan *works only* with an *order by*? localdb=# explain analyse verbose select uid from mm where uid>100 *order by* uid; QUERY PLAN

Re: [GENERAL] Unable to understand index only scan as it is not happening for one table while it happens for other

2017-06-27 Thread Chris Travers
On Tue, Jun 27, 2017 at 1:09 PM, rajan wrote: > Please help me to understand the following, > > *For the following query Index Only Scan to be performance as I am querying > the indexed fields alone. There are 20 fields in this table, inclusive of > the three I am selecting.* > localdb=# explain

Re: [GENERAL] Accessing DB2 tables from postgresql

2017-06-27 Thread Achilleas Mantzios
On 27/06/2017 13:11, Swapnil Vaze wrote: Hello, I am trying to access few table present in DB2 LUW from postgres9.5 database. I have installed unixODBC driver and connection to DB2 is working fine. I have installed CartoDB/odbc_fdw foreign data wrappers. I have user below commands to create for

[GENERAL] Unable to understand index only scan as it is not happening for one table while it happens for other

2017-06-27 Thread rajan
Please help me to understand the following, *For the following query Index Only Scan to be performance as I am querying the indexed fields alone. There are 20 fields in this table, inclusive of the three I am selecting.* localdb=# explain analyse verbose select uid, guid from mm where uid=100 limi

[GENERAL] Accessing DB2 tables from postgresql

2017-06-27 Thread Swapnil Vaze
Hello, I am trying to access few table present in DB2 LUW from postgres9.5 database. I have installed unixODBC driver and connection to DB2 is working fine. I have installed CartoDB/odbc_fdw foreign data wrappers. I have user below commands to create foreign table: $ create extension odbc_fdw; $

Re: [GENERAL] ERROR: query returned no rows

2017-06-27 Thread Alexander Farber
Thank you Adrian, with \sf+ words_skip_game(integer, integer) the line 85 was correct