Fellow monkians,

I ask this question here only because I consider you all to be a vast fount of knowledge. I apologize in advance for this not being strictly perlish question, but it ties closely to much of the database programming/administration that I've been doing with perl.

I know how to get mysql to tell me about queries that do not utilize indexes, or run slower than they should, and that's all well and good. But I have a number of databases (legacy) that I'm maintaining that have almost EVERYTHING indexed. These are very large dbs, and the size of the indexes not only cause there to be disk space considerations, but it causes things like altering tables/inserts/deletions/updates to often take longer than I think they should due to indexes being updated.

So my question is this: Is there any way of profiling the normal usage of the mysql server to determine which indexes are/are not used. Even if an index is only used once a week , I may decide to keep it... I believe many are NEVER used, and simply wasting space. I'd like to be able to drop those indexes, but I can't just start dropping them and see what slows down. Rebuilding the indexes on many of these tables takes a minimum of hours if not days!

Hopefully someone has some insight?? Thanks!

In reply to Mysql question... by hubb0r

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.