我有一个包含约90万行的表。我想删除约90%的行。尝试使用TABLESAMPLE随机选择它们,但性能没有太大提高。这是我尝试过的查询,还有很多次
sql> DELETE FROM users WHERE id IN (
SELECT id FROM users ORDER BY random() LIMIT 5000
)
[2017-11-22 11:35:39] 5000 rows affected in 1m 11s 55ms
sql> DELETE FROM users WHERE id IN (
SELECT id FROM users TABLESAMPLE BERNOULLI (5)
)
[2017-11-22 11:55:07] 5845 rows affected in 1m 13s 666ms
sql> DELETE FROM users WHERE id IN (
SELECT id FROM users TABLESAMPLE SYSTEM (5)
)
[2017-11-22 11:57:59] 5486 rows affected in 1m 4s 574ms
Run Code Online (Sandbox Code Playgroud)
仅删除5%的数据大约需要一分钟。因此,大数据将花费很长时间。请建议我是否做正确的事,或者是否有更好的方法来做到这一点。
#include<fstream>
using namespace std;
int
main()
{
char name[30];
int marks;
ofstream fout("student.out");
cout<<"Enter name";
cin>>name;
cout<<"Enter marks secured:";
cin>>marks;
fout<<name<<endl;
fout<<marks<<endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
请帮我用gcc编译上面的程序.当我编译这个程序时,我得到以下错误.
stdfile.cpp: In function 'int main()':
stdfile.cpp:12:1: error: 'cout' was not declared in this scope
stdfile.cpp:13:1: error: 'cin' was not declared in this scope
Run Code Online (Sandbox Code Playgroud) 我编写了下面的代码来使用jquery进行ajax调用:
$.ajax({
url: 'verify.php',
type: 'POST',
data: {
'mobile': 'update'
}
success: function(response) {
if (response == 'success') {
$('#popupscreen').fadeOut('slow');
}
else {
$("#error").html("<p>" + Registration failed! Please try again. + "</p>").show();
}
}
});
Run Code Online (Sandbox Code Playgroud)
我收到错误Uncaught SyntaxError:行成功中的意外标识符:function(response){ 为什么我收到此错误?
我写了以下php调用 fetchdetails.php
<?php
$db ="fb";
$con = mysql_connect("host","user","paswd") or die ("hi ".mysql_error());
mysql_select_db($db) or die("helo".mysql_error());
$id = $_POST["id"];
echo $id;
$id = (string)$id;
echo $id."hi";
Run Code Online (Sandbox Code Playgroud)
当我用它来调用它www.anyaddress.com/fetchdetails.php?id=1722315但echo $ id没有显示任何内容.尽快需要帮助.实际上我之前在其他一些代码中做了同样的事情并且工作正常.