In an attempt to throw the authorities off his trail, Chris Gehlker gehlker@fastq.com transmitted:
If an SQL database is being used, then perhaps the filesystem
doesn’t have to get traversed, but that certainly doesn’t eliminate
the need to traverse the database.
But the difference is the difference between accessing one file and
accessing every file. That’s tremendous.
But that’s not the difference.
A “find” command does not read every file. It reads a database
containing metadata about the files. It does not read the contents of
those files.
In effect, “find” is doing exactly the same thing.
It does not read every file.
Let me say that several more times, because that fact seems not to be
sinking in successfully.
It (“file”) does not read every file. It does not read every
file. IT DOES NOT READ EVERY FILE.
There is no “tremendous difference.” If all “find” is being used for
is to get names of files (and perhaps attributes), then it is not
reading the files. It is reading a database of metadata.
If you’re walking through a filesystem that has 17,000 files, then a
run of “find” will have to walk through the set of filesystem blocks
that contain 17,000 directory entries containing the metadata for
those 17,000 files.
Change that to a SQL query, and it changes insubstantially to
walking through the set of database blocks that contain 17,000
directory entries containing the metadata for those 17,000 files.
The only crucial difference between those approaches is that the data
may be somewhat more compact in an SQL database. Otherwise, there is
no reason to expect any difference in overall behaviour. RDBMSes
are commonly implemented as B-Trees. Filesystem directory structures
are also commonly implemented as B-Trees. Not a difference.
···
On 6/17/02 11:36 AM, “Christopher Browne” cbbrowne@acm.org wrote:
–
(concatenate 'string “cbbrowne” “@cbbrowne.com”)
http://www.ntlug.org/~cbbrowne/fs.html
Ever heard of .cshrc?
That’s a city in Bosnia. Right?
(Discussion in comp.os.linux.misc on the intuitiveness of commands.)