It would be useful to know the version of Moodle?
The log tables can get incredibly large on a busy site and it has been known to have some performance issues (it's just the way databases work). I normally recommend keeping logs for a limited time - just to keep a lid on it.
There's some talk of changing Moodle logging in a forthcoming version to log to files (which can be rotated by standard OS tools) which would offer a better solution. I don't know how definite that is.