Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Invalid database query
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Dec 9, 2014 - 9:20 am

Do you know I have never investigated that and will clearly have to. InnoDB tables are more efficient and lock by row instead of table during operations. It might be that they do not fragment in quite the same way.

I will google it....

andy-signature.png
YELLOW
SWORDFISH
Avatar
kvr28
Member
Free Members
sp_UserOfflineSmall Offline
Dec 9, 2014 - 9:25 am

I ggogled it last night after reading this thread and came across this on stack overflow

For InnoDB tables, OPTIMIZE TABLE is mapped to ALTER TABLE, which rebuilds the table to update index statistics and free unused space in the clustered index. Beginning with MySQL 5.1.27, this is displayed in the output of OPTIMIZE TABLE when you run it on an InnoDB table, as shown here:

You can make OPTIMIZE TABLE work on other storage engines by starting mysqld with the --skip-new or --safe-mode option. In this case, OPTIMIZE TABLE is just mapped to ALTER TABLE.

http://stackoverflow.com/quest.....nodb-table

but I have no clue what that means lol

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Dec 9, 2014 - 10:32 am

I have to say that Stack Overflow always seems to me to be either spot on or a long way off! I don't see evidence to back this up on the MySQL documentation website pages I have looked at so far. I have also just tried an optimise run against my own innoDB based database tables with no problems whatsoever. 

The one thing it did suggest however is that you really only need to optimise when the database starts to get big although defining big is the same as the length of a piece of string. To quote:

Once your data reaches a stable size, or a growing table has increased by tens or some hundreds of megabytes, consider using the OPTIMIZE TABLE statement to reorganize the table and compact any wasted space. The reorganized tables require less disk I/O to perform full table scans.

so - if you are getting an error back from an optimise attempt I think i would be asking your host why that is to be honest - as it appears there should be no issue doing so.

andy-signature.png
YELLOW
SWORDFISH
Avatar
kvr28
Member
Free Members
sp_UserOfflineSmall Offline
Dec 9, 2014 - 1:58 pm

I will pose the question, what version of sql are you using? we have 5.5.4

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Dec 9, 2014 - 3:12 pm

I am using version 5.5.29...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Dec 9, 2014 - 10:19 pm

just to pile on....  I use 5.6.17...  on this site, we use 5.6.21...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626