Tag Info

Hot answers tagged

2

I might be guessing on this one, but I think the key distribution must be insane. POSSIBILITY #1 Please run this SELECT * FROM ( SELECT IFNULL(user_id,-1) user_id,COUNT(1) prod_count FROM products GROUP BY IFNULL(user_id,-1) ) A ORDER BY prod_count DESC; If you can send the output to a text file, look for user_id 12 and compare its prod_count to ...


2

Install percona-toolkit. Then you can use pt-online-schema-change. I usually use it when I have to alter tables. What it does is copy the data from your current table to another table. Triggers are automatically created, that copy incoming data to the copy while copying. This only works flawlessly if you don't have triggers on the table already. After that, ...


2

I've written this in SQL Server so you may have to translate to MySQL but this should work for you. CREATE TABLE #ExcludeList (ExcludeVal varchar(50)) CREATE TABLE #VideoList (VideoName varchar(500)) INSERT INTO #ExcludeList VALUES ('Prob1'),('Prob2'),('DontUse1') INSERT INTO #VideoList VALUES ('This is a prob1'), ('This is clean'),('This is ...


1

MattU's comment above about caching was enough to help me find a solution. Whilst reading about those settings mentioned, I came across innodb-flush-log-at-trx-commit which was set to 1 but I've now set to 2. There are a couple of tables which we're using like a queue (refactoring this into a different architecture more suited is on our TODO list) and thus ...


1

You literally do not need a third party tool. STEP 01 Find out the path to the data by running mysql> SHOW GLOBAL VARIABLES LIKE 'datadir'; For this example, let's suppose it is C:\Program Files\MySQL\MySQL 5.6\data STEP 02 Pick a destination folder to copy the data directory For this example, let's pick D:\MySQLBackup STEP 03 Create batch file ...


1

As you say, temporary tables are only visible within the session, and materialized views are not available in MySQL. There are several options (including the ones you have mentioned). I will name your original query as SELECT ...: The WITH Oracle keyword is equivalent to CREATE TEMPORARY TABLE: CREATE TEMPORARY TABLE savedquery AS SELECT ...; -- you ...



Only top voted, non community-wiki answers of a minimum length are eligible