-1

I have read a lot about indexing in Mysql and I know that Linux has a great utility locate to find files. Maybe Linux has the same principle to do indexing as Mysql have provided. But I think the nugget of indexing lies in the structure of inodes in Linux.

My question is: What are the best ways of implementing indexing in Linux? (e.g. directory index, file index...) And how indexing works in most usual cases? I would be really appreciative for the full answer.

P.S I have already cut through stackoverflow, unix.stackexchange and askubuntu trying to find answer: indexing, support indexing and so on.

fuser
  • 677
  • 3
  • 17
  • 29
  • 2
    `locate` is just a user-level tool indexing files. It has more or less nothing to do with the actual implementation of the file system in linux. `locate` has its own database, which you can update with `updatedb`. – jofel Apr 22 '16 at 16:24
  • For sure, you explanation about `locate` clearer than mine in topic. Thanks. Despite all these, I would like to have explicit definition of indexing mechanism in the Linux itself. – fuser Apr 22 '16 at 16:33
  • It is still not clear what your question is about - is it about some generic file indexing, or about filesystem implementation details (i.e. how directory index is implemented)? – rvs Apr 22 '16 at 16:36
  • 1
    What do you mean by "indexing mechanism in Linux itself"? There is no general purpose file indexing mechanism. Individual applications (mysql, rpm, apt, locate, etc) all provide their own particular implementation, based on their needs and the whims of the developer. – larsks Apr 22 '16 at 16:37
  • rvs, I corrected my question due to your proposals. `How directory index implemented` would be the best. – fuser Apr 22 '16 at 16:42
  • 1
    @fuser as I said, this depends on filesystem. You should probably just google it. Here's the doc I found in 10 seconds: https://www.kernel.org/doc/ols/2002/ols2002-pages-425-438.pdf – rvs Apr 22 '16 at 16:48

1 Answers1

2

There is no "mechanism of any file indexing" in Linux kernel.

There are some user-space tools such as locate (+updatedb), KDE Nepomuk and similar.

Now, filesystems may have use some clever techniques to store directory indexes, but it has nothing to do with locate & friends - it is merely a filesystem implementation detail, and it depends on what filesystem is being used.

rvs
  • 1,633
  • 13
  • 13