Index: branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectDao.cs
===================================================================
--- branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectDao.cs	(revision 15659)
+++ branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectDao.cs	(revision 15666)
@@ -28,4 +28,10 @@
   public class ProjectDao : GenericDao<Guid, Project> {
     public ProjectDao(DataContext dataContext) : base(dataContext) { }
+
+    public class ProjectStats {
+      public Guid ProjectId { get; set; }
+      public int Cores { get; set; }
+      public int Memory { get; set; }
+    }
 
     public override Project GetById(Guid id) {
@@ -70,4 +76,12 @@
     }
 
+    public IEnumerable<ProjectStats> GetUsageStatsPerProject() {
+      return DataContext.ExecuteQuery<ProjectStats>(GetUsageStatsPerProjectQueryString).ToList();
+    }
+
+    public IEnumerable<ProjectStats> GetAvailabilityStatsPerProject() {
+      return DataContext.ExecuteQuery<ProjectStats>(GetAvailabilityStatsPerProjectQueryString).ToList();
+    }
+
     #region Compiled queries
     private static readonly Func<DataContext, Guid, Project> GetByIdQuery =
@@ -79,4 +93,38 @@
 
     #region String queries
+    private const string GetUsageStatsPerProjectQueryString = @"
+      SELECT j.ProjectId, SUM(t.CoresNeeded) AS Cores, SUM(t.MemoryNeeded) AS Memory
+      FROM [Task] t, [Job] j
+      WHERE t.TaskState = 'Calculating'
+      AND t.JobId = j.JobId
+      GROUP BY j.ProjectId
+    ";
+
+    private const string GetAvailabilityStatsPerProjectQueryString = @"
+      WITH rtree AS
+      (
+	      SELECT ResourceId, ParentResourceId
+	      FROM [Resource]
+	      UNION ALL
+	      SELECT rt.ResourceId, r.ParentResourceId
+	      FROM [Resource] r
+	      JOIN rtree rt ON rt.ParentResourceId = r.ResourceId
+      )
+      SELECT apr.ProjectId, SUM(res.Cores) AS Cores, SUM(res.Memory) AS Memory
+      FROM rtree, [AssignedProjectResource] apr, [Resource] res
+      WHERE rtree.ResourceId = res.ResourceId
+      AND res.ResourceType = 'Slave'
+      AND (res.SlaveState = 'Idle' OR SlaveState = 'Calculating')
+      AND rtree.ParentResourceId = apr.ResourceId
+      GROUP BY apr.ProjectId
+      UNION
+      SELECT apr.ProjectId, SUM(res.Cores) AS Cores, SUM(res.Memory) AS Memory
+      FROM [AssignedProjectResource] apr, [Resource] res
+      WHERE apr.ResourceId = res.ResourceId
+      AND res.ResourceType = 'Slave'
+      AND (res.SlaveState = 'Idle' OR SlaveState = 'Calculating')
+      GROUP BY apr.ProjectId
+    ";
+
     private const string GetUsageGrantedProjectsForUserQueryString = @"
       SELECT DISTINCT p.*
Index: branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/TaskDao.cs
===================================================================
--- branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/TaskDao.cs	(revision 15659)
+++ branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/TaskDao.cs	(revision 15666)
@@ -93,12 +93,11 @@
 
     #region String queries
-    private const string GetParentTasksQueryString = @"
-      SELECT t.* FROM [Task] t, [Job] j, [AssignedJobResource] ajr
-        WHERE t.IsParentTask = 1
-        AND t.TaskState = 'Waiting'
+    private const string GetCalculatingChildTasksByProjectId = @"
+      SELECT t.* FROM [Task] t, [Job] j
+        WHERE t.IsParentTask = 0
+        AND t.TaskState = 'Calculating'
         AND t.JobId = j.JobId
-        AND j.JobId = ajr.JobId
-        AND t.FinishWhenChildJobsFinished = 1
-        ... TODO (not necessary)
+        AND j.ProjectId = {0}
+        ORDER BY j.ProjectId
     ";
     private const string GetWaitingTasksQueryString = @"
Index: branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/HiveStatisticsGenerator.cs
===================================================================
--- branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/HiveStatisticsGenerator.cs	(revision 15659)
+++ branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/HiveStatisticsGenerator.cs	(revision 15666)
@@ -59,5 +59,5 @@
           pm.UseTransaction(() => {
             UpdateFactClientInfoTable(time, pm);
-            UpdateFactProjectInfoTable(time, pm); // in progress
+            UpdateFactProjectInfoTable(time, pm);
             pm.SubmitChanges();
           });
@@ -118,4 +118,7 @@
     }
 
+    // add new projects
+    // delete expired projects
+    // update information of existing projects
     private void UpdateDimProjectTable(PersistenceManager pm) {
       var projectDao = pm.ProjectDao;
@@ -353,5 +356,25 @@
 
     private void UpdateFactProjectInfoTable(DimTime newTime, PersistenceManager pm) {
-      // TODO
+      var factProjectInfoDao = pm.FactProjectInfoDao;
+      var dimProjectDao = pm.DimProjectDao;
+      var projectDao = pm.ProjectDao;
+
+      var projectAvailabilityStats = projectDao.GetAvailabilityStatsPerProject();
+      var projectUsageStats = projectDao.GetUsageStatsPerProject();
+      var dimProjects = dimProjectDao.GetAllOnlineProjects().ToList();
+
+      factProjectInfoDao.Save(
+        from dimp in dimProjects
+        let aStats = projectAvailabilityStats.Where(x => x.ProjectId == dimp.ProjectId).SingleOrDefault()
+        let uStats = projectUsageStats.Where(x => x.ProjectId == dimp.ProjectId).SingleOrDefault()
+        select new FactProjectInfo {
+            ProjectId = dimp.ProjectId,
+            DimTime = newTime,
+            NumTotalCores = aStats != null ? aStats.Cores : 0,
+            TotalMemory = aStats != null ? aStats.Memory : 0,
+            NumUsedCores = uStats != null ? uStats.Cores : 0,
+            UsedMemory = uStats != null ? uStats.Memory : 0
+          }
+        );
     }
 
