Re: [PERFORM] Strange query plan invloving a view

2005-11-22 Thread Rich Doughty
Tom Lane wrote: Rich Doughty [EMAIL PROTECTED] writes: However, the following query (which i believe should be equivalent) SELECT * FROM tokens.ta_tokenhist h INNER JOIN tokens.ta_tokens t ON h.token_id = t.token_id LEFT JOIN tokens.ta_tokenhist i ON

Re: [PERFORM] Strange query plan invloving a view

2005-11-17 Thread Tom Lane
Rich Doughty [EMAIL PROTECTED] writes: However, the following query (which i believe should be equivalent) SELECT * FROM tokens.ta_tokenhist h INNER JOIN tokens.ta_tokens t ON h.token_id = t.token_id LEFT JOIN tokens.ta_tokenhist i ON t.token_id = i.token_id AND

[PERFORM] Strange query plan invloving a view

2005-11-16 Thread Rich Doughty
i have the following query involving a view that i really need to optimise: SELECT * FROM tokens.ta_tokenhist h INNER JOIN tokens.vw_tokenst ON h.token_id = t.token_id WHERE h.sarreport_id = 9 ; where vw_tokens is defined as CREATE VIEW tokens.vw_tokens AS SELECT