Hi,

I have a script using DBI to make lots of select queries and print them out on to a html table.

Everytime the script is called, I use the prepare_cache method to execute each select query. Depending on the search results, the # of select queries made will depend.

This HTML table contains several categories, lets say category 1, category 2, category 3, all the way up to 6 categories.

To fill the table with data, each category has its own select query that will be return the data to be printed on.

So my script is a lot of prepare_cache's , and one while { statement that will contain all the $sth-execute($a) commands.

What I'm stuck on is whether to continue using this route and hope for the best if it the site ever grows large. Its potential may be 50,000 viwers viewing this script causing massive select queries being made a day. If I can avoid making this many queries, should I do so? Or a script making this many queries using a prepare_cache method in DBI is normal?

Thanks, Bobby

In reply to How many Select Querie is considered too much? by Anonymous Monk

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.