Re: Postgresql Sort cost Poor performance? - Mailing list pgsql-performance

From tank.zhang
Subject Re: Postgresql Sort cost Poor performance?
Date
Msg-id 1554188409091-0.post@n3.nabble.com
Whole thread Raw
In response to Re: Postgresql Sort cost Poor performance?  (Ramón Bastidas <ramon.r.bastidas@gmail.com>)
Responses Re: Postgresql Sort cost Poor performance?
List pgsql-performance
1、DISTINCT response time is fast without being added

qis3_dp2=# SELECT COUNT(*) AS CHECKCARNUM FROM QIS_CARPASSEDSTATION A WHERE
1=1 AND A.SSTATIONCD = 'VQ3_LYG' AND A.SLINENO IN ( '1F' , '2F' , '3F' ) AND
A.DWORKDATE >= TO_DATE('2017-02-11','YYYY-MM-DD') AND A.DWORKDATE <=
TO_DATE('2019-03-11','YYYY-MM-DD');
 checkcarnum
-------------
     2142215
(1 row)

*Time: 2237.970 ms (00:02.238)*
qis3_dp2=#

2、 Adding a DISTINCT response time was very slow

qis3_dp2=# SELECT COUNT(DISTINCT SVIN) AS CHECKCARNUM FROM
QIS_CARPASSEDSTATION A WHERE 1=1 AND A.SSTATIONCD = 'VQ3_LYG' AND A.SLINENO
IN ( '1F' , '2F' , '3F' ) AND A.DWORKDATE >=
TO_DATE('2017-02-11','YYYY-MM-DD') AND A.DWORKDATE <=
TO_DATE('2019-03-11','YYYY-MM-DD');
 checkcarnum
-------------
     1071367
(1 row)

*Time: 38979.246 ms (00:38.979)*





--
Sent from: http://www.postgresql-archive.org/PostgreSQL-performance-f2050081.html



pgsql-performance by date:

Previous
From: Ramón Bastidas
Date:
Subject: Re: Postgresql Sort cost Poor performance?
Next
From: David Rowley
Date:
Subject: Re: Postgresql Sort cost Poor performance?