Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 May 2002 09:38:24 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Anna M =?iso-8859-1?Q?Ruthstr=F6m?= <anna.ruthstrom@teligent.se>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: Filesystem
Message-ID:  <3CD16B80.BAC37697@mindspring.com>
References:  <NGBBLHHAELMPLDFPNEGAOEEKCAAA.anna.ruthstrom@teligent.se>

next in thread | previous in thread | raw e-mail | index | archive | help
Anna M Ruthstr=F6m wrote:
> Hello,
> =

> Im sing bsd 3.4 on my current system.
> Is there any limitation of how many directorys you can have in one
> directory, and if so can this parameter be changed? I heard something a=
but
> 32 676 directorys in a directory, is this true?

There is no limitation except inodes and available disk space.

However, it's an incredibly bad idea to have huge numbers of
entries in a directory, since search time for all but a few
FS implementations is linear, so depending on a faster search
time would make your code dependent on a particular UNIX or
FS implementation.

It's always a bad idea to intentionally write non-portable code.

If you are trying to abuse the FS name space as a hierarchical
database with a wide key space, you would be better off:

1)	Using a real database, where search will be O(log2(N))
	instead of O(N) for non-existant entries and O(N/2)
	for exiting entries

2)	Using a relational instead of a hierarchical database;
	by their nature, hierarchical databases are designed
	to be deep and not wide

3)	Or use a hierarchical database with tier indexing, so
	that certain tiers can be very wide, but most data is
	hierarchical (an example of this would be an LDAP
	directory; see http://www.openldap.org )

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-fs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3CD16B80.BAC37697>