Let's say I have 1000 computers, all nearly identical builds, users add and change things here an there, but overall very identical boxes. Let's assume I'm collecting the path, name and file version for each file on a users PC. How do I create an efficient index, I don't want to store c:\windows\system32\notepad.exe a thousand times in the db, I would think each machine could have a pointer instead to that files entry (granted the path/version/name match, lets assume they do)
The concept is as follows...
machine01 has files: 1-200, 344, 421-500, 512-566, 578, 590, 600-700 etc...
Or should it go the other way
notepad.exe is on machines: 1-88, 90-95, 100
calc.exe is on machines: 2-41, 42, 44, 48-90, 92-100
Each machine writes a local inventory, ftp's the file to a server that add's the files/path/version to the db, and would then be able to through and update pointers after all the file data is entered.
Well I guess I'm kind of answering my own question, if I want to search for machines with calc.exe on them, the second example is clearly better... I'm going to ask the question anyway in case I have no idea what I'm talking about.
I'm also wanting to track the changes... machine01 had files 44, 67, 99 changed to 1002, 1003, 1004, and files 2, 19 and 55 deleted. I know I'm all over the place with this question, but it should convey the idea.
-rich
by: KdoPosted on 2009-07-17 at 13:12:01ID: 24882441
Hi Rich,
Store the path names in one table and the file names in another. When you store a file name, store the primary key of the path name in the filename record.
CREATE TABLE pathnames
(
id integer IDENTITY, -- some syntax omitted
name varchar (3000)
);
CREATE TABLE filenames
(
id integer IDENTITY, -- omitted here, too.
pathid integer,
name varchar (150)
);
Assume two paths are in the database
id path
1 c:\
2 c:\temp
Then store the files in the root directory into the filename table
id pathid name
1 1 config.sys
2 1 autoexec.bat
3 1 command.com
And add the files in c:\temp
id pathid name
4 2 readme.txt
5 3 someotherfile
etc....
Kent