小编tec*_*ude的帖子

为什么MySQL'插入... select ...'比单独选择要慢得多?

我正在尝试将查询结果存储在临时表中以供进一步处理.

create temporary table tmpTest
(
    a FLOAT,
    b FLOAT,
    c FLOAT
)
engine = memory;

insert into tmpTest
(
    select a,b,c from someTable
    where ...
);
Run Code Online (Sandbox Code Playgroud)

但由于某种原因,插入需要一分钟,而单独的子选择只需要几秒钟.为什么将数据写入临时表而不是将其打印到我的SQL管理工具的输出需要这么长时间?

更新 我的设置:MySQL 7.3.2集群,带有8个Debian Linux ndb数据节点1个SQL节点(Windows Server 2012)

我正在运行select on的表是一个ndb表.

我试图找出,如果执行计划在使用'insert into ..'时会有所不同,但它们看起来一样:(抱歉格式化,stackoverflow没有表格)

id  select_type     table       type    possible_keys   key     key_len ref                 rows        Extra
1   PRIMARY         <subquery3> ALL     \N              \N      \N      \N                  \N          \N
1   PRIMARY         foo         ref     PRIMARY         PRIMARY 3       <subquery3>.fooId   9747434     Using where
2   SUBQUERY        someTable   range   PRIMARY         PRIMARY 3       \N                  136933000 …

mysql performance temp-tables insert-into mysql-cluster

11
推荐指数
2
解决办法
1万
查看次数

Internet Explorer 10不会发送Ajax发布数据

好吧,我研究了几个小时,我仍然难过.

Internet Explorer 10将使用jquery提交ajax请求,但不包括发布数据.

这是代码:

var ajaxData = "FirstName="+encodeURIComponent($('#FirstName').val()); //get the data from the account form
                ajaxData += "&LastName="+encodeURIComponent($('#LastName').val()); 
                ajaxData += "&EmailAddress="+encodeURIComponent($('#EmailAddress').val());
                ajaxData += "&CAT_Custom_246311="+encodeURIComponent(listData);

                var config = {
                    async: false,
                    type: "POST",
                    url: "/FormProcessv2.aspx?WebFormID=44714&OID={module_oid}&OTYPE={module_otype}&EID={module_eid}&CID={module_cid}&JSON=1",
                    dataType: "json", // text"json",
                    processData: false,
                    data: ajaxData,
                    timeout: 70000,
                    cache: false,

                };

                $.ajax(config)
                .done(function(data, event) {
                    if(data.FormProcessV2Response.success == true){ //success field is in BC response
                        alert("The list was submitted sucessfully.");
                        console.log(XHR);
                    } else{
                        alert("An error occurred and the list was not submitted.");
                    }
                }) …
Run Code Online (Sandbox Code Playgroud)

ajax jquery post internet-explorer internet-explorer-10

6
推荐指数
1
解决办法
6725
查看次数