Re: Speed of postgres compared to ms sql, is this

From: "Tomi N/A" <hefest(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: harding(dot)ian(at)gmail(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: Speed of postgres compared to ms sql, is this
Date: 2006-12-05 22:32:03
Message-ID: d487eb8e0612051432k56c9d73s53e17d7e3370af4e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2006/12/5, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:

> These sorts of reports would be far more helpful if they contained some
> specifics. What queries does MSSQL do better than Postgres, exactly?

You are of course correct, Tom.
I'm sorry I'm not in a position to replay what I've been doing a year
ago...I wish I could.

Obviously, I never had to worry about the concepts of vacuuming and
analysis (not that it's very difficult with pgsql: it just doesn't
exist as a concept with MSSQL).
Anyone calling my comment completely subjective would be completely
correct because that's what it was.

One type of query does come to mind, now that I think about it.
pgsql has trouble handling queries like
SELECT * FROM t0 WHERE t0.id_t1 IN (SELECT t1.id FROM t1 WHERE...)

The performance is a bit better when there's only one result in the
subselect so you can do:
SELECT * FROM t0 WHERE t0.id_t1 = (SELECT t1.id FROM t1 WHERE...)

When the subselect returns a lot of results, pgsql really takes it's time.

The first query, however, can be executed much, much (at least an
order of magnitude) quicker like this:
SELECT * FROM t0
LEFT OUTER JOIN t1 ON t1.id = t0.id_t1
WHERE t1.id IS NOT NULL

I didn't notice this kind of sensitivity with MSSQL, but again, I
can't easily reproduce what I've been doing.

Sorry for the original FUD-like report. Cheers,
t.n.a.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ragnar 2006-12-05 22:35:10 Re: Anything I can do to speed up this query?
Previous Message Mike G 2006-12-05 22:31:54 Re: Speed of postgres compared to ms sql, is this