I loaded ~100M rows into my sql using the 'load data' command. After loading the data, I checked the information schema and saw that the table was populated:
SELECT table_name "Table Name", table_rows "Rows Count", round(((data_length +
index_length)/1024/1024),2) "Table Size (MB)" FROM information_schema.TABLES
WHERE table_schema = "testDB" AND table_name ="TweetPerson";
+-------------+------------+-----------------+
| Table Name | Rows Count | Table Size (MB) |
+-------------+------------+-----------------+
| TweetPerson | 88355921 | 19517.00 |
+-------------+------------+-----------------+
But when I try to count the rows of the table or use any select statements on it I get row count of 0 or the empty set:
select count(*) from TweetPerson;
+----------+
| count(*) |
+----------+
| 0 |
+----------+
I am using MySQL 5.6. When I loaded the data I used the following commands to speed up the process:
SET FOREIGN_KEY_CHECKS = 0;
SET UNIQUE_CHECKS = 0;
SET SESSION tx_isolation='READ-UNCOMMITTED';
SET sql_log_bin = 0;
SET autocommit = 0;
What could be the issue here?
Thanks
UPDATE After the load data I tried to set autocommit back to 1 but it did not change anything. I restarted the load from the beginning with autocommit set to 1 and the data loaded correctly.
I can't tell what was the problem with the first data loading but I highly suspect that it had something to do with the autocommit.
select count(*) from databasename.TweetPerson;select * from TweetPersonworks?