Re: number of files in a dir vs. performace
| From: | Miguel Cruz | Date: | Tue, 23 Jul 2002 05:52:08 +0000 |
| Subject: | Re: number of files in a dir vs. performace | ||
| References: | 1 | Groups: | php.db php.general |
| Request: | Send a blank email to php-db+get-20726@lists.php.net to get a copy of this message | ||
On Mon, 22 Jul 2002, eat pasta type fasta wrote:
> currently I am holding all of the files in 1 directory since the DB can
> keep track of them, however their number has grown to over 400 at this
> point
>
> my issue is whether it would be worth it (performance wise) to split them
> into thumbs and works thus having 200+ files per directory as opposed to
> so many, I am expecting the number of images to double in the future.
400 is not very many. Tens of thousands can start to become a problem.
Look at the distribution of your file names and come up with a hashing
mechanism. For instance, if your filenames are numbers, create
subdirectories 0/ 1/ 2/ 3/ 4/ etc., and place the files based on their
final digit.
miguel