Note that there are some explanatory texts on larger screens.

plurals
  1. POSuper slow query with CROSS JOIN
    primarykey
    data
    text
    <p>I have two tables named table_1 (1GB) and reference (250Mb). </p> <p>When I query a cross join on reference it takes 16hours to update table_1 .. We changed the system files EXT3 for XFS but still it's taking 16hrs.. WHAT AM I DOING WRONG??</p> <p>Here is the update/cross join query : </p> <pre><code> mysql&gt; UPDATE table_1 CROSS JOIN reference ON -&gt; (table_1.start &gt;= reference.txStart AND table_1.end &lt;= reference.txEnd) -&gt; SET table_1.name = reference.name; Query OK, 17311434 rows affected (16 hours 36 min 48.62 sec) Rows matched: 17311434 Changed: 17311434 Warnings: 0 </code></pre> <p>Here is a show create table of table_1 and reference:</p> <pre><code> CREATE TABLE `table_1` ( `strand` char(1) DEFAULT NULL, `chr` varchar(10) DEFAULT NULL, `start` int(11) DEFAULT NULL, `end` int(11) DEFAULT NULL, `name` varchar(255) DEFAULT NULL, `name2` varchar(255) DEFAULT NULL, KEY `annot` (`start`,`end`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ; CREATE TABLE `reference` ( `bin` smallint(5) unsigned NOT NULL, `name` varchar(255) NOT NULL, `chrom` varchar(255) NOT NULL, `strand` char(1) NOT NULL, `txStart` int(10) unsigned NOT NULL, `txEnd` int(10) unsigned NOT NULL, `cdsStart` int(10) unsigned NOT NULL, `cdsEnd` int(10) unsigned NOT NULL, `exonCount` int(10) unsigned NOT NULL, `exonStarts` longblob NOT NULL, `exonEnds` longblob NOT NULL, `score` int(11) DEFAULT NULL, `name2` varchar(255) NOT NULL, `cdsStartStat` enum('none','unk','incmpl','cmpl') NOT NULL, `cdsEndStat` enum('none','unk','incmpl','cmpl') NOT NULL, `exonFrames` longblob NOT NULL, KEY `chrom` (`chrom`,`bin`), KEY `name` (`name`), KEY `name2` (`name2`), KEY `annot` (`txStart`,`txEnd`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ; </code></pre>
    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.
 

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