Robert Fitzpatrick <lists@webtent.net> writes:
> On Tue, 2007-05-22 at 17:21 +0100, Richard Huxton wrote:
>> Your query seems to produce 41.8 million rows. Are you sure MS-SQL is
>> returning that many rows in a few seconds?
> I thought the same thing. While I'm not a MS SQL guru, I put 'TOP 100
> PERCENT' after SELECT in the query. The Enterprise Manager does not
> indicate how many rows come back. I save it as a VIEW in MS SQL and do a
> 'select count(*)...' and, yes, it comes back 42164877 records.
> Just to be sure MS SQL hasn't done something to the structure (I noticed
> dbo prefixes, etc.), I pasted back into pgadmin, took off 'top 100
> percent'. Then saved as a view and did a count(*) in pgsql, got
> 41866801.
How much time do the two select count(*) operations take? That would be
a reasonably fair comparison of the query engines, as opposed to
whatever might be happening on the client side (in particular, I wonder
whether the MS client is actually fetching all the rows or just the
first few).
regards, tom lane