I am working on a site-search for someone that allows perl regexp searches. The site is not that big (10 gb) but it is still too much to actually be parsing all the pages for every search, so I have to extract all the content and put it in some kind of database.

My first thought thought was to use SQL, which I presume that will work fine. I am positive that the "expense" of the operation is not the volume of data searched -- it's having to parse through the directory tree opening and closing hundreds of files. One giant SQL table will probably be much faster.

HOWEVER, there will not be much further purpose to using an SQL db, since I want to use the perl regexp engine on the data, not SQL type queries (ie, I would just being going straight thru the table pulling all data anyway).

So, I could just put ALL the text into one flat file, with tag lines to indicate paths. This will be just as quick -- or quicker? -- than using SQL (I think). Another option would be to use Storable or YAML.

For sure someone(s) around here have done much writing of search engines like this. Any opinions? My intuition tells me that the flat file will actually be fastest, but I really don't know.

In reply to What DB style to use with search engine by halfcountplus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.