Better HN
topnewbestaskshowjobs
Log inSign up

interactive_rep

4 karma · joined Jan 27, 2014 (12y ago) · 2 submissions

Submissions

comment 12y ago · link · parent

Another reason postgres could be running very slow, is that it may be spooling the intermediate result to a temp file on hard disk.

Do you see a performance increase when using SSD Drives?

comment 12y ago · link · parent

One of the reasons you are seeing that the subquery runs twice as fast on most of the databases ( like SQL server, oracle & MySQL), is that it is able to execute the query with one pass through of the data. When it is taking twice as long (without the subquery), it is doing a second pass for the count distinct.