WITH discussion_count AS (
SELECT count(*) cnt FROM discussion WHERE author_id=?
),
discussion_messages_count AS (
SELECT count(*) cnt FROM discussion_messages WHERE author_id=?
)
SELECT
p.name, dc.cnt discussions, dmc.cnt dcount
FROM people p, discussion_count dc, discussion_messages_count dmc
WHERE p.id=?