×
Login Register an account
Top Submissions Explore Upgoat Search Random Subverse Random Post Colorize! Site Rules
0

Anyone know why a mysql query call to simply select count(*) would take 9 seconds for 2.3 million entries?

submitted by CoronaHoax to Linux 1 weekMay 7, 2024 16:16:01 ago (+0/-0)     (Linux)

I moved a db from a personal machine to a VPS, mariadb to mysql, and now -

select count(*) from table_name;

calls are taking like 9 seconds.

Also a lot of other calls that used to take like 0.5 seconds now take 10. They're all calls that are under an index...

Can anyone please tell do you know are there any settings that are likely to alleviate this? I'm finding it hard to believe just 2.5 million records are causing this much slow down just because it's a VPS (4 gb ram, 2 cpus, should be respectable enough hd access)?


2 comments block


[ - ] chrimony 0 points 1 weekMay 7, 2024 18:19:18 ago (+0/-0)

Could be the VPS you are on is oversubscribed or just slow as fuck. Some things to try:

o Rent a machine for an hour or two from one of the cloud providers.
o Move to a dedicated host.

If you get the same performance by following the same steps as your original move, then it's a "you" problem.

[ - ] Not_a_redfugee 0 points 1 weekMay 7, 2024 17:56:58 ago (+0/-0)

Try turning it off and on again