Replication Issues

2018-09-28 Thread bhargav kamineni
Hi Team, I have configured replication using slot ,But it failed by throwing the ERROR *pg_basebackup: could not get transaction log end position from server: ERROR: requested WAL segment 00012C9D0085 has already been removed *, which is unexpected because i have created the slot

Re: How to maintain the csv log files in pg_log directory only for past 30 days

2018-09-28 Thread Raghavendra Rao J S V
Thanks for the prompt response. On Fri 28 Sep, 2018, 10:55 AM Michael Paquier, wrote: > On Fri, Sep 28, 2018 at 10:33:30AM +0530, Raghavendra Rao J S V wrote: > > Log file will be generated in *csv* format at *pg_log* directory in our > > PostgreSQL. Every day we are getting one log file. We

Re: Replication Issues

2018-09-28 Thread Achilleas Mantzios
On 28/9/18 9:00 π.μ., bhargav kamineni wrote: Hi Team, I have configured replication using slot ,But it failed by throwing the ERROR /pg_basebackup: could not get transaction log end position from server: ERROR:  requested WAL segment 00012C9D0085 has already been removed /, which

Re: Replication Issues

2018-09-28 Thread Laurenz Albe
bhargav kamineni wrote: > Hi Team, > > I have configured replication using slot ,But it failed by throwing the > ERROR pg_basebackup: could not get transaction log end position from server: > ERROR: requested WAL segment 00012C9D0085 has already been > removed , > which is

Re: Why my query not using index to sort?

2018-09-28 Thread Adrian Klaver
On 9/28/18 12:14 PM, Arup Rakshit wrote: Forgot to mention in my previous email, it was a quick send click. Sorry for that. In the gist you need to see all the line with Vessel Load(.. . I load the page multiple times to catch the different times, so you will the line multiple times there in

ORM

2018-09-28 Thread marcelo
For a new big and convoluted project I (am/was) using Devart´s LinqConnect as ORM. But today I experienced some inexplicable "object reference not set to an instance of an object" exceptions or other more specific to this libraries. I would wish to change the ORM. Some experiences would be

Re: How to maintain the csv log files in pg_log directory only for past 30 days

2018-09-28 Thread Michael Paquier
On Fri, Sep 28, 2018 at 06:19:16AM -0700, Adrian Klaver wrote: > If log_truncate_on_rotation = 'on', correct? Yup, thanks for precising. -- Michael signature.asc Description: PGP signature

Re: ORM

2018-09-28 Thread Adrian Klaver
On 9/28/18 3:49 PM, marcelo wrote: For a new big and convoluted project I (am/was) using Devart´s LinqConnect as ORM. But today I experienced some inexplicable "object reference not set to an instance of an object" exceptions or other more specific to this libraries. I would wish to change

Re: Help to understand Actual Rows vs Plan Rows from the query planner output

2018-09-28 Thread Arup Rakshit
Hi, > This is a broad topic, and I can only give you some hints. Yes when I am reading this https://www.postgresql.org/docs/10/static/using-explain.html I found the doc said like “...Plan-reading is an art that requires some

Re: How to maintain the csv log files in pg_log directory only for past 30 days

2018-09-28 Thread Francisco Olarte
On Fri, Sep 28, 2018 at 7:03 AM, Raghavendra Rao J S V wrote: > Log file will be generated in csv format at pg_log directory in our > PostgreSQL. Every day we are getting one log file. We would like to maintain > only max 30 days. Which setting need to modify by us in “postgresql.conf” in > order

Re: How to maintain the csv log files in pg_log directory only for past 30 days

2018-09-28 Thread Ron
On 09/28/2018 12:03 AM, Raghavendra Rao J S V wrote: Hi All, Log file will be generated in *csv* format at *pg_log* directory in our PostgreSQL. Every day we are getting one log file. We would like to maintain only max 30 days. Which setting need to modify by us in “postgresql.conf” in

Re: Why my query not using index to sort?

2018-09-28 Thread Tom Lane
Arup Rakshit writes: > My query is not using name index to sort the result. Given the rowcounts here, I think the planner is making the right choice. Sorting 70-some rows with a Sort node is probably cheaper than doing random disk I/O to get them in sorted order. With more rows involved, it

Re: Why my query not using index to sort?

2018-09-28 Thread Arup Rakshit
Hi Adrian, > The application is? It is Ruby On Rails application > The log settings are? > Where is it being printed? The default application log, the production.log file. > What is being printed? Check the gist: https://gist.github.com/aruprakshit/a6bd7ca221c9a13cd583e0827aa24ad6

Re: Why my query not using index to sort?

2018-09-28 Thread Arup Rakshit
Yes. But I thought I could improve it, so that it can be finished in 0.xx ms. It takes now between 1.7 to 1.9 ms in production. Thanks, Arup Rakshit a...@zeit.io > On 28-Sep-2018, at 9:46 PM, Andreas Kretschmer > wrote: > > > > Am 28.09.2018 um 18:03 schrieb Arup Rakshit: >> Also I

Re: Why my query not using index to sort?

2018-09-28 Thread Adrian Klaver
On 9/28/18 11:32 AM, Arup Rakshit wrote: Yes. But I thought I could improve it, so that it can be finished in 0.xx ms. It takes now between 1.7 to 1.9 ms in production. That is not what you showed in your first post: Planning time: 0.178 ms Execution time: 0.527 ms Thanks, Arup Rakshit

Re: Why my query not using index to sort?

2018-09-28 Thread Adrian Klaver
On 9/28/18 11:51 AM, Arup Rakshit wrote: Yes, I have shown the explain plan output. But in my application log the sql query prints 1.7 to 1.9 ms. So you have added another layer to the process. The application is? The log settings are? What is being printed? Where is it being printed?

Re: Why my query not using index to sort?

2018-09-28 Thread Arup Rakshit
Yes, I have shown the explain plan output. But in my application log the sql query prints 1.7 to 1.9 ms. Thanks, Arup Rakshit a...@zeit.io > On 29-Sep-2018, at 12:17 AM, Adrian Klaver wrote: > > On 9/28/18 11:32 AM, Arup Rakshit wrote: >> Yes. But I thought I could improve it, so that it

Re: Why my query not using index to sort?

2018-09-28 Thread Rob Sargent
On 09/28/2018 12:51 PM, Arup Rakshit wrote: Yes, I have shown the explain plan output. But in my application log the sql query prints 1.7 to 1.9 ms. How often does the production app make this call?  Apparently it could do it 500 times per second.  But at such a rate the network

Re: Why my query not using index to sort?

2018-09-28 Thread Arup Rakshit
Forgot to mention in my previous email, it was a quick send click. Sorry for that. In the gist you need to see all the line with Vessel Load(.. . I load the page multiple times to catch the different times, so you will the line multiple times there in the log file. Thanks, Arup Rakshit

Re: How to maintain the csv log files in pg_log directory only for past 30 days

2018-09-28 Thread Raghavendra Rao J S V
Hi All, Hope you all are recommending below settings to maintain only max 30 days logs in *pg_log* directory. Please correct me if I am wrong. log_filename = 'postgresql-%d.log' log_truncate_on_rotation = 'on', Regards, Raghavendra Rao On Sat, 29 Sep 2018 at 04:24, Michael Paquier wrote: >

Re: Why my query not using index to sort?

2018-09-28 Thread Arup Rakshit
Hello Tom, Here is the plan with `enable_sort = off`. # set enable_sort = off; SET # explain analyze select "vessels" .* from "vessels"

regarding bdr extension

2018-09-28 Thread Durgamahesh Manne
Hi This is regarding bdr extension issue. I got below error at the time i have tried to create the bdr extention ERROR: could not open extension control file "opt/PostgreSQL/10/share/postgresql/extension/bdr.control": No such file or directory Regards Durgamahesh Manne

Re: Replication Issues

2018-09-28 Thread bhargav kamineni
Ee are using 9.5 version, slot option -s is not available ,can I go with -X stream option ? On Fri 28 Sep, 2018, 12:01 PM Laurenz Albe, wrote: > bhargav kamineni wrote: > > Hi Team, > > > > I have configured replication using slot ,But it failed by throwing the > > ERROR pg_basebackup: could

Re: Replication Issues

2018-09-28 Thread Achilleas Mantzios
On 28/9/18 1:50 μ.μ., bhargav kamineni wrote: Ee are using 9.5 version, slot option -s is not available ,can I go with -X stream option ? -S is intended when you plan to use the backup as a hot standby, when you must use the same replication slot. If you plan to use the backup as a stand

Why my query not using index to sort?

2018-09-28 Thread Arup Rakshit
My query is not using name index to sort the result. explain analyze select "vessels" .* from "vessels" where "vessels"."deleted_at" is null and "vessels"."company_id" = '86529964-6e9b-4bfa-ba9e-62bd24eaa954' order by "vessels"."name" ASC; I have below

Re: Why my query not using index to sort?

2018-09-28 Thread Ravi Krishna
> Is there anyway, I can improve the sorting so that it can use the index ? Are you telling that why PG is not simply reading the data from the index (which is already in sorted order)?

Re: How to maintain the csv log files in pg_log directory only for past 30 days

2018-09-28 Thread Adrian Klaver
On 9/27/18 10:25 PM, Michael Paquier wrote: On Fri, Sep 28, 2018 at 10:33:30AM +0530, Raghavendra Rao J S V wrote: Log file will be generated in *csv* format at *pg_log* directory in our PostgreSQL. Every day we are getting one log file. We would like to maintain only max 30 days. Which setting

Re: Why my query not using index to sort?

2018-09-28 Thread Arup Rakshit
Oh I see. That makes sense, I was reading too much into that line.. :) Thanks, Arup Rakshit a...@zeit.io > On 28-Sep-2018, at 9:29 PM, Andreas Kretschmer > wrote: > > > > Am 28.09.2018 um 16:49 schrieb Arup Rakshit: >> Planning time: 1.867 ms >> Execution time: 0.252 ms >> (6 rows) >>

Re: Why my query not using index to sort?

2018-09-28 Thread Andreas Kretschmer
Am 28.09.2018 um 16:49 schrieb Arup Rakshit:  Planning time: 1.867 ms  Execution time: 0.252 ms (6 rows) Why it is showing *6 rows*? Also it seems less than what I had before: the explain-output are 6 rows ;-) Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company.

Re: Why my query not using index to sort?

2018-09-28 Thread Arup Rakshit
Also I meatn the execution time is less than I had before with enable_sort = off. Why 6 rows was a side question. :) Thanks, Arup Rakshit a...@zeit.io > On 28-Sep-2018, at 9:29 PM, Andreas Kretschmer > wrote: > > > > Am 28.09.2018 um 16:49 schrieb Arup Rakshit: >> Planning time: 1.867

Re: Why my query not using index to sort?

2018-09-28 Thread Andreas Kretschmer
Am 28.09.2018 um 18:03 schrieb Arup Rakshit: Also I meatn the execution time is less than I had before with enable_sort = off. yeah, but not that much. different plan. Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company. www.2ndQuadrant.com

Re: regarding bdr extension

2018-09-28 Thread Adrian Klaver
On 9/28/18 8:41 AM, Durgamahesh Manne wrote: Hi This is regarding bdr extension issue. I got below error at the time i have tried to create the bdr extention ERROR: could not open extension control file "opt/PostgreSQL/10/share/postgresql/extension/bdr.control": No such file or directory