Re: Query Performance SQL Server vs. Postgresql - Mailing list pgsql-performance

From Tom Lane
Subject Re: Query Performance SQL Server vs. Postgresql
Date
Msg-id 26558.1290036078@sss.pgh.pa.us
Whole thread Raw
In response to Re: Query Performance SQL Server vs. Postgresql  (Humair Mohammed <humairm@hotmail.com>)
Responses Re: Query Performance SQL Server vs. Postgresql
List pgsql-performance
Humair Mohammed <humairm@hotmail.com> writes:
> Yes strange indeed, I did rerun ANALYZE and VACCUM. Took 70 seconds to rerun the query. Results from EXPLAIN ANALYZE
below:
> "Hash Join  (cost=16212.30..52586.43 rows=92869 width=17) (actual time=43200.223..49502.874 rows=3163 loops=1)""
HashCond: (((pb.id)::text = (pg.id)::text) AND ((pb.question)::text = (pg.question)::text))""  Join Filter:
((COALESCE(pb.response,'MISSING'::character varying))::text <> (COALESCE(pg.response, 'MISSING'::character
varying))::text)"" ->  Seq Scan on pivotbad pb  (cost=0.00..2804.96 rows=93496 width=134) (actual time=0.009..48.200
rows=93496loops=1)""  ->  Hash  (cost=7537.12..7537.12 rows=251212 width=134) (actual time=42919.453..42919.453
rows=251212loops=1)""        Buckets: 1024  Batches: 64  Memory Usage: 650kB""        ->  Seq Scan on pivotgood pg
(cost=0.00..7537.12rows=251212 width=134) (actual time=0.119..173.019 rows=251212 loops=1)""Total runtime: 49503.450
ms"

I have no idea how much memory SQL Server thinks it can use, but
Postgres is limiting itself to work_mem which you've apparently left at
the default 1MB.  You might get a fairer comparison by bumping that up
some --- try 32MB or so.  You want it high enough so that the Hash
output doesn't say there are multiple batches.

            regards, tom lane

pgsql-performance by date:

Previous
From: Scott Carey
Date:
Subject: Re: Defaulting wal_sync_method to fdatasync on Linux for 9.1?
Next
From: Ivan Voras
Date:
Subject: Re: How to achieve sustained disk performance of 1.25 GB write for 5 mins