Note that there are some explanatory texts on larger screens.

plurals
  1. POmysql denormalization with triggers, specific advice
    primarykey
    data
    text
    <p>I'm considering adding some denormalized information in my database by adding <strong>one</strong> denormalized table fed by <strong>many (~8)</strong> normalized tables, specifically for improving select query times of a core use case on my site. </p> <p>The problems with the current method of querying are:</p> <ol> <li><p><strong>Slow query times,</strong> there are between 8 and 12 joins (some of the left joins) to access the information for this Use Case this can take ~ 3000ms for some queries.</p></li> <li><p><strong>Table Locking / Blocking</strong>, When information is updated during busy times of the day or week, (because I'm using MyIsam tables) queries are locked / blocked and this can cause further issues (connections running out, worse performance)</p></li> </ol> <p>I'm using Hibernate (3.5.2), Mysql 5.0 (all MyIsam tables) and Java 1.6</p> <p>I'd like some specific suggestions (preferrably based on concrete experience) about exactly what would be the best way to update the the denormalized table.</p> <p>The following come to my mind</p> <ol> <li>Create a denormalized table with the <strong>InnoDb</strong> type so that I get <strong>row</strong> level locking rather than table locking</li> <li>Create triggers on the properly normalized tables that update the denormalized table,</li> </ol> <p>I'm looking for:</p> <ol> <li>Gotchas - things that I may not be thinking about that will affect my desired result.</li> <li>Specific MySql settings that may improve performance, reduce locking / blocking on the denormalized table.</li> <li>Best approaches to writing the Triggers for this scenario.</li> <li>?</li> </ol> <p>Let me know if there is any other information needed to help answer this question.</p> <p>Cheers.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload