Activity feed does not show all changeset activity
I think it only shows the first commit from the first day in the time window
I think this may be a bug in postgres
Here's the relevant query:
SELECT "changesets"."id" AS t0_r0 FROM "changesets" LEFT OUTER JOIN "repositories" ON "repositories".id = "changesets".repository_id LEFT OUTER JOIN "projects" ON "projects".id = "repositories".project_id inner join enabled_modules em on em.name = 'repository' and projects.id = em.project_id WHERE --( (1=1 AND changesets.committed_on BETWEEN '2009-10-22' AND '2009-11-21') AND ((projects.id = 1 OR (projects.lft > 1 AND projects.rgt < 2))) AND (projects.status=1 ) --AND projects.id in (SELECT em.project_id FROM enabled_modules em WHERE em.name='repository')
I get the correct number of lines (146 in my database) if I use an inner join to limit the projects to those where the repository is enabled.
If however, I use the subquery that is written by the redmine code, I get only 1 line (commented out here)
I know that pg 8.4 did some optimizations with subqueries
I'm running postgresql-8.4 (8.4.0-2) from debian.
this is with a recent checkout of 0.9pre
Updated by Jean-Philippe Lang about 14 years ago
Found this in the postgres 8.4.1 release notes:
Fix several errors in planning of semi-joins (Tom)
These led to wrong query results in some cases where IN or EXISTS was used together with another join.
It may be related to your problem with 8.4.0.