Hi there
I have a database (mysql) with around 80000 entries. All entries have codes like this: wey134. These codes represent certain 'groupings' and a significant number of entries can belong to the same grouping and therefore have the same code to refer to that.
Each entry has its own unique ID. For every entry, I want to do some analysis - comparing the first entry for example with every other entry in the database. But I only want to do the analysis on that entry with all other entries that are NOT in the same grouping.
As it's a large database, I want to make sure I write an efficient program. I want to go though each entry in the database and then compare that entry with all other entries and pull out those that are not in the same grouping as the first entry of interest.
So - I thought of using fetch_arrayref for that and go though each entry in the array one at a time using a for loop and then create another for loop within that one which would go though all other entries and then compare with 'group codes' and pull out those that are different to the initial entry.
I'm concerned though in case this would make for a particularly slow program and I was wondering if anyone had suggestions for writing a program that would make the process faster.
Thanks a lot.

In reply to an efficient program? by Angharad

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.