Re: 7.3.1 New install, large queries are slow - Mailing list pgsql-performance

From Tom Lane
Subject Re: 7.3.1 New install, large queries are slow
Date
Msg-id 11547.1042691700@sss.pgh.pa.us
Whole thread Raw
In response to Re: 7.3.1 New install, large queries are slow  ("Roman Fail" <rfail@posportal.com>)
Responses Re: 7.3.1 New install, large queries are slow  ("Josh Berkus" <josh@agliodbs.com>)
Re: 7.3.1 New install, large queries are slow  (Kevin Brown <kevin@sysexperts.com>)
Re: 7.3.1 New install, large queries are slow  ("Charles H. Woloszynski" <chw@clearmetrix.com>)
List pgsql-performance
"Roman Fail" <rfail@posportal.com> writes:
> Thanks to everyone for the quick replies!  I'm sure that my lack of
> skill with SQL queries is the main problem.  What's strange to me is
> how MSSQL takes my bad queries and makes them look good anyway.  It
> must have a real smart planner.

I think more likely the issue is that your use of JOIN syntax is forcing
Postgres into a bad plan.  MSSQL probably doesn't assign any semantic
significance to the use of "a JOIN b" syntax as opposed to "FROM a, b"
syntax.  Postgres does.  Whether this is a bug or a feature depends on
your point of view --- but there are folks out there who find it to be
a life-saver.  You can find some explanations at
http://www.ca.postgresql.org/users-lounge/docs/7.3/postgres/explicit-joins.html

> Is it pretty much universally accepted that I should drop all my
> foreign keys?

No.  They don't have any effect on SELECT performance in Postgres.
They will impact update speed, but that's not your complaint (at the
moment).  Don't throw away data integrity protection until you know
you need to.

            regards, tom lane

pgsql-performance by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: 7.3.1 New install, large queries are slow
Next
From: "Josh Berkus"
Date:
Subject: Re: 7.3.1 New install, large queries are slow