Closed Misiur closed 7 years ago
You can get the query ID by executing SHOW processlist
.
A better solution would be setting a query timeout hint (MySQL 5.7+ only):
SELECT /*+ MAX_EXECUTION_TIME(1000) */ * FROM t1 INNER JOIN t2 WHERE ....
Hm, but that would kill legitimate heavy queries (though 1 second is a massive amount of time even when dealing with full server of players). However I'm using MariaDB so I have to send additional SET STATEMENT max_statement_time=1000
.
I'll report with my findings in future.
That timeout hint is per-query only. On MariaDB 10.1.2+ it would look like this (also per-query only; timeout is in seconds):
SET STATEMENT max_statement_time=1 FOR SELECT field1 FROM table_name ORDER BY field1
Oh, I didn't notice the FOR
and assumed there was a semicolon. That certainly makes things easier
Hi! I've looked at your login implementation and noticed the race condition checks. I would prefer not having to do that for all player queries. Quick googling tells me there exists
KILL QUERY
. Would you consider adding support for it? I think mysql_*query functions would have to return query id for that.