Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Identify what makes slow.</p> <h2>check JOIN is optimized</h2> <p>run SELECT only:</p> <pre><code>SELECT COUNT(*) FROM xxx.product p LEFT JOIN xx.tof_art_lookup l ON p.model_view = l.ARL_SEARCH_NUMBER; </code></pre> <p>how long takes? and <code>EXPLAIN SELECT ...</code> check proper <code>INDEX</code> is used for JOIN.</p> <p>If everything is fine for JOIN, then UPDATEing row is slow. this situation is hard to make things faster.</p> <h2>UPDATE = DELETE and INSERT</h2> <p>I didn't tried this. but sometimes, this strategy is faster.. <code>UPDATE</code> is DELETE old row and INSERT new row using new value. </p> <pre><code>// CREATE new table and INSERT CREATE TABLE xxx.new_product SELECT p.model_model, l. ARL_DISPLAY_NR, ... FROM xxx.product p LEFT JOIN xx.tof_art_lookup l ON p.model_view = l.ARL_SEARCH_NUMBER; // drop xxx.procuct // rename xxx.new_product to xxx.product </code></pre> <h2>divide table into small chunk, and run concurrently</h2> <p>I think your job is CPU bounded and your UPDATE query uses just one CPU can't have benefit many cores. xxx.product TABLE has no constraint for join, there for 1M rows are updated sequencially</p> <p>My suggestion following. </p> <p>give some conditions to xxx.product so that xxx.product divided 20 group. (I don't no which column would be better for you, as I have no information about xxx.product)</p> <p>then run 20 queries at once concurrently.</p> <p>for example:</p> <pre><code>// for 1st chunk UPDATE xxx.product AS p ... WHERE p.model_view = l.ARL_SEARCH_NUMBER AND p.column BETWEEN val1 AND val2; &lt;= this condition spliting xxx.product // for 2nd chunk UPDATE xxx.product AS p ... WHERE p.model_view = l.ARL_SEARCH_NUMBER AND p.column BETWEEN val2 AND val3; ... ... // for 20th chunk UPDATE xxx.product AS p ... WHERE p.model_view = l.ARL_SEARCH_NUMBER AND p.column BETWEEN val19 AND val20; </code></pre> <p>It is important to find BETWEEN value distribute table evenly. Histogram may help you. <a href="https://stackoverflow.com/questions/1764881/mysql-getting-data-for-histogram-plot">Getting data for histogram plot</a></p>
    singulars
    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.
    1. VO
      singulars
      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