Re: Postgresql Sort cost Poor performance?

2019-04-01 Thread Ramón Bastidas
Hi, If your problem is the sort, try creating an index on the Field that you consider thst could be needed (you can star with smtoc that is the one you are grouping and sorting) Another thing that i noticed is your work_mem, I thing is too high for a global config (if you think 2gb can hel for t

Re: Good afternoon.

2019-04-01 Thread Ramón Bastidas
Hi Kenia, Take a look of this link https://wiki.postgresql.org/wiki/Monitoring#pg_activity I think you are looking for something line pg_activity But in that official pgsql documentation you'll find all you need to monitor queries and pgsql cluster behavior On Wed, Mar 6, 2019, 7:45 PM Kenia V

Re: LIMIT OFFSET with DB view vs plain SQL

2019-04-01 Thread Ramón Bastidas
Hi Raj, I have long time without working on pgsql performance, but you can try materialized views or if you are already using its try apply some performance tips... This are some link i found in a fast search, but if you solution is going by this way this can be a kickstart to solve your problem.

Re: LIMIT OFFSET with DB view vs plain SQL

2019-04-01 Thread SAMEER KUMAR
Thanks, Sameer +65 81100350 *Please consider the environment before printing this e-mail!* On Mon, Apr 1, 2019 at 9:57 PM Raj Gandhi wrote: > Any other idea how to resolve the performance issue with the database view? > > On Fri, Mar 29, 2019 at 7:38 PM Raj Gandhi wrote: > >> Merlin, I tried

Re: LIMIT OFFSET with DB view vs plain SQL

2019-04-01 Thread Raj Gandhi
Thanks Rui. The performance of using function is close to the plain SQL. Why Query planner is choosing different path with DB view? explain analyze select foo(101,0); QUERY PLAN ---

Re: LIMIT OFFSET with DB view vs plain SQL

2019-04-01 Thread Raj Gandhi
Any other idea how to resolve the performance issue with the database view? On Fri, Mar 29, 2019 at 7:38 PM Raj Gandhi wrote: > Merlin, I tried the hack you suggested but that didn't work. Planner used > the same path. > > The same query works much faster when using the raw SQL instead of DB >

Re: Good afternoon.

2019-04-01 Thread Rafia Sabih
On Wed, 6 Mar 2019 at 23:45, Kenia Vergara wrote: > Good afternoon. > I need to know the commands to display the execution time, CPU usage and > memory usage, but through the Postgres console.Thank you. > You might want to have a look at, https://aaronparecki.com/2015/02/19/8/monitoring-cpu-memo

Re: trying to analyze deadlock

2019-04-01 Thread Mariel Cherkassky
Got it, thanks Laurenz ! ‫בתאריך יום ד׳, 27 במרץ 2019 ב-15:20 מאת ‪Laurenz Albe‬‏ <‪ laurenz.a...@cybertec.at‬‏>:‬ > Mariel Cherkassky wrote: > > Hi all, > > I'm trying to analyze a deadlock that I have in one of our environments. > > The deadlock message : > > > > 06:15:49 EET db 14563 DETAIL:

Re: Postgresql Sort cost Poor performance?

2019-04-01 Thread Christoph Berg
Re: Gavin Flower 2019-04-01 <3113f2f4-a4da-4862-8596-2e189398c...@archidevsys.co.nz> > Would it be possible to optionally enable the system to create a hidden > system column for the text field to be sorted, the new column would be the > original column preprocessed to sort correctly & efficiently

Re: Postgresql Sort cost Poor performance?

2019-04-01 Thread Gavin Flower
On 01/04/2019 23:20, Andrew Gierth wrote: "tank" == tank zhang <6220...@qq.com> writes: tank> smtoc| character varying(50) | | | tank> Sort Key: smtoc What is the output of SHOW lc_collate; One of the most common reasons for slow sorting is that

Re: Postgresql Sort cost Poor performance?

2019-04-01 Thread tank.zhang
Thank you for your reply. qis3_dp2=> SHOW lc_collate; lc_collate - en_US.UTF-8 (1 row) Time: 0.311 ms qis3_dp2=> qis3_dp2=> SELECT COUNT(DISTINCT SVIN) AS CHECKCARNUM ,SMTOC FROM QIS_CARPASSEDSTATION A WHERE 1=1 AND A.SSTATIONCD = 'VQ3_LYG' AND A.SLINYYY-MM-DD') AND A.DWORKDAT

Re: Postgresql Sort cost Poor performance?

2019-04-01 Thread Andrew Gierth
> "tank" == tank zhang <6220...@qq.com> writes: tank> smtoc| character varying(50) | | | tank> Sort Key: smtoc What is the output of SHOW lc_collate; One of the most common reasons for slow sorting is that you're sorting a text/varchar field in

Postgresql Sort cost Poor performance?

2019-04-01 Thread tank.zhang
1、postgresql version qis3_dp2=> select * from version(); version - PostgreSQL 11.1 on x86_64-p