|
From: Phil S. <al...@me...> - 2012-06-11 21:24:12
|
On 06/11/2012 04:51 PM, Domen Kožar wrote:
> You will have to write an SQL query that does the following:
>
> - selects all jobs from the client that you are interested in
> - filter by path where backup was stored
> - generate path/filenames for all jobs (they are base64 encoded)
> - with programming language filter results by *flyer*
Or, you could do something like the following:
mysql> select * from Filename where Name like '%flyer%';
You *REALLY* want to do this as a search on a single table, NOT part of
a join, because your filename fragment both begins and ends with a
wildcard, and therefore your DB cannot use an index to search for it,
which means it's going to force a full table scan. You want that full
table scan to happen on a single table, not on a join of five tables.
Once you have identified a likely filename, do something like this:
mysql> select File.FileId, Path.Path, Filename.Name, Client.Name,
Job.JobId from File join Filename on File.FilenameId =
Filename.FilenameId join Path on File.PathId = Path.PathId join Job on
Job.JobId = File.JobId join Client on Job.ClientId = Client.ClientId
where Filename.Name = 'your filename here';
This will give you the name of the client, the job ID it was backed up
in, and where on that client it is located.
--
Phil Stracchino, CDK#2 DoD#299792458 ICBM: 43.5607, -71.355
al...@ca... al...@me... ph...@co...
Renaissance Man, Unix ronin, Perl hacker, SQL wrangler, Free Stater
It's not the years, it's the mileage.
|