Sergei Shelukhin wrote:
Hi. I have the following join condition in a query "posttag inner join tag ON posttag.tagid = tag.id and tag.name = 'blah'" tag.id is PK, I have indexes on posttag.tagid and tag.name both created with all the options set to default. PG version is 8.1. The query is very slow (3 minutes on test data), here's what takes all the time, from explain results:Any ideas?
Yes, post the output of explain analyze select ... (rest of query here) for starters