On Tue, November 24, 2009 18:59, Christoph Litauer wrote: > And another demand, please: > > Could you - or someone else - please select any JobId and execute the following (my)sql-statement: > > mysql>EXPLAIN SELECT Path.Path, Filename.Name, File.FileIndex, > File.JobId, File.LStat > FROM ( > SELECT max(FileId) as FileId, PathId, FilenameId > FROM ( > SELECT FileId, PathId, FilenameId > FROM File > WHERE JobId IN (<insert your JobId here>) > ) AS F GROUP BY PathId, FilenameId > ) AS Temp JOIN Filename ON (Filename.FilenameId = Temp.FilenameId) JOIN Path ON (Path.PathId = Temp.PathId) JOIN File ON (File.FileId = > Temp.FileId) WHERE File.FileIndex > 0 ORDER BY JobId, FileIndex ASC > > Please post the result. Thanks in advance! > Solaris 10, x64, 64-bit Webstack MySQL 5.1: +----+-------------+------------+--------+-----------------------+---------+---------+-------+------+-------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+------------+--------+-----------------------+---------+---------+-------+------+-------+ | 1 | PRIMARY | <derived2> | system | NULL | NULL | NULL | NULL | 1 | | | 1 | PRIMARY | Filename | const | PRIMARY | PRIMARY | 4 | const | 1 | | | 1 | PRIMARY | Path | const | PRIMARY | PRIMARY | 4 | const | 1 | | | 1 | PRIMARY | File | const | PRIMARY | PRIMARY | 8 | const | 1 | | | 2 | DERIVED | <derived3> | system | NULL | NULL | NULL | NULL | 1 | | | 3 | DERIVED | File | ref | JobId,JobId_3,JobId_2 | JobId | 4 | | 1 | | +----+-------------+------------+--------+-----------------------+---------+---------+-------+------+-------+ 6 rows in set (0.06 sec)
------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users