Re: static virtual columns as result?

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <pstm(dot)spain(at)gmail(dot)com>,<pgsql-performance(at)postgresql(dot)org>
Subject: Re: static virtual columns as result?
Date: 2012-07-03 13:44:50
Message-ID: 4FF2B1020200002500048D3F@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

PV wrote:

> Any suggestion?

You provided too little information to suggest much beyond using JOIN
instead of a subquery. Something like:

SELECT pr.id, pr.catid, cat.a, cat.b
FROM pr join cat ON (cat.id = pr.catid)
WHERE "lft" > 1 AND "rgt" < 10 AND (...)
ORDER BY cat.id
OFFSET 0 LIMIT 40;

We can provide more specific suggestions if you follow the advice
here:

http://wiki.postgresql.org/wiki/SlowQueryQuestions

And please format your queries to make them more readable --
something like I did above.

-Kevin

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Stanislaw Pankevich 2012-07-03 15:22:43 PostgreSQL db, 30 tables with number of rows < 100 (not huge) - the fastest way to clean each non-empty table and reset unique identifier column of empty ones.
Previous Message PV 2012-07-03 09:29:09 static virtual columns as result?