InnoDB: Right For Write-heavy Table? Server Tuning?
I've decided to merge 4500 identical tables into one. They were previously partitioned with one table per user of the system, but I'm imagining I may not need to do this anymore for this particular table. I'd like to do so to reduce the number of files in this database's directory (currently over 15,000), to reduce backup complexity, and maybe improve performance. That's where I'm still unsure.
This is the summary table for W3Counter with fields website_id, date, unique_visits, return_visits, page_views. The website_id and date uniquely identify each row.
It is a write-heavy table (probably more than 99% INSERT/UPDATE compared to SELECT). I may be making things up, but I believe I remember InnoDB showing superior performance for this type of table. I'd imagine row-level locking would decrease lock contention when being hit by dozens of threads concurrently -- queries trying to update different rows would be allowed since that row isn't locked, unlike MyISAM where the entire table is locked by each query.
Merging all the tables into this one would mean starting with about 1.5 million rows and growing about 4500 per day.
So what do you think? Is InnoDB the right way to go for this table? Should I expect better performance than MyISAM for the inserts/updates? Should I expect the same or better performance on SELECTs that SUM() those counts over various date ranges, and sometimes group by WEEK(), MONTH() or YEAR() on the date column? I'm not sure whether the primary key is sufficient for that type of query, if a key on just the website_id would help those, or what. Any opinions?
My other reason for this thread is to get some pointers on tuning the server variables for InnoDB tables. There's much less written about this than those mainly applicable to MyISAM tables. Which are most important for a table like this? Right now no other tables will be InnoDB as the rest benefit greatly from MyISAM-specific features (like prefix compression on indexes and maintenance of row counts).
View Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
Fine Tuning InnoDB Database
I feel like a raging bull trying to run a porcelain shop, but I have a question about changing some variables on the server. I'm trying to insert data into a table, which are several thousand records for each file that I'm reading into the database, only the processing of the data goes painfully slow. The database still runs on it's default settings. Anyone has any advices for changes of the server side variables in order to be able to process the data faster?
View Replies !
View Related
Foreign Keys Without Using InnoDB? (Server Disabled InnoDB - Any Way To Link Tables?)
I guess this is a two-part question: 1) Is there any way to use foreign keys (and enforce them) without storing them in InnoDB? My hosted server vendor has disabled InnoDB access across the board because it requires remote access (not quite sure I understand the why) and they only want people to edit through their online GUI.... 2) If there's absolutely no way to link tables without using InnoDB, would anyone recommend a good hosting service that allows it? Tech support for readyhosting said there's no way any shared server service is going to allow this, but since it's a HUGE part of the functionality of relational databases,
View Replies !
View Related
Cant Write Or Delete To Table
I cant get my php script to insert or delete records into a mysql table. I can view them all fine but that's about it. I've checked the user permissions on mysql and have set them all to 'Y' incase that was the problem but still no joy. Can anyone suggest what the problem may be? I'm tried the usual RTFM but cant spot the problem
View Replies !
View Related
Read/write Table Efficiency
I've got a bit of an efficiency question, and just trying to figure out how best to manage this. For my site HearWhere.com, I have a table which holds artists shows. When i am refreshing the collection of shows and geocoding the locations, the database response for user queries slows significantly - which is understandable. One option I'm considering is to have one database which the users connect to for queries, and a second separate database for writing the updates, and then I can just move the updated database to become the live database on a daily basis. The other option I think is just to have a separate table which I write the updates to, and then just replace the table the users interact with from the table which was updated Either way I go, at the moment everything would be done on the same sql server - I don't currently have enough traffic to justify multiple servers.
View Replies !
View Related
Search And Write, Or Write And Recover?
The problem: I need to generate a 'unique string' for each row in a table. I already use auto_increment for system dependencies between tables. What is the best approach one of these or another? After generating a candidate 'unique string' the two strategies that came to mind are: 1. to then search the table's column to see if it is already assigned; locking the table for write while searching and writing the new row, or 2. set the column to UNIQUE when defining the table. Just go ahead and write the new row if you get a "non-unique" exception, generate another 'unique string' and try again. I've tried both on a small XP laptop and get "lock timeout exceptions" rather quickly using #1. But replace those with lots of re-writes when there starts to get "collisions" of 'unique string's.
View Replies !
View Related
Write/Move/Save Pdf To MySQL Table?
Is upload the only way to pass a file to a table? I have a contract.pdf which is generated via php (FPDF) and saved in a temporary file. I need that file then moved /written to the appropriate customer table in our database (MySQL ) so that the temporary file may then be overwritten by the next Customer/Order. While I am able to upload the file via <input type="file" name="uploadpdf> and related uploader.php, asking our web-users to “browse” for the file does not suit our needs, and of course adding a default value <input type="file" name="uploadpdf" value="http://localhost/crm/modules/Orders/contract.pdf"> doesn’t work either. As the file is always the same (modules/Orders/contract.pdf) how may I manage that move automatically, (say with a ‘Confirm Order’ button) to the database?
View Replies !
View Related
Innodb And Server Date
I have an innodb database running a week now. I have noticed that the time of my linux server is not the correct (about 9 minutes ahead). I was wondering if by synchronizing my server's clock with an ntp, I would confuse any innodb logs, because the correct time would be set 9 minutes earlier from the current incorrect time.
View Replies !
View Related
ERROR 1022 (23000): Can't Write; Duplicate Key In Table On SELECT
I'm using the mysql server that comes with ubuntu-server 8.04 (mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (i486) using readline 5.2) and I have a rather big database (about 5M records). If I try to do this mysql> select count(*),lastname from data group by lastname; all i get is the following error: ERROR 1022 (23000): Can't write; duplicate key in table '' The lastname column is the only one returning this error. (The statement works for firstname, city, street, etc...) Does anybody have an idea as to what's happening here? I've tried searching but could only find this error in relation to database updates and insertions (which would be logical considering the 'duplicate key' part).
View Replies !
View Related
Update Heavy Data
We have an os commerce application with a database of 7mb is working fine on our local server but when we are trying to update the data from local to online server via phpmyadmin we are unable to upload it there. Is any other way or idea to upload the file to server? "we can do it by root access of server but we dont have that acess in our hosting"
View Replies !
View Related
Heavy Traffic System
I am developing a very heavy traffic site. It may happen that at same time (exactly same) two user will try to register with the same username. What will be the approach to prevent this situation. Which user will be able to register and which one will be denied? Do I need to use any locking facility? If so is it a wise decision to lock entire table?
View Replies !
View Related
InnoDB & Multiple Mysqld's On 1 Server
i've been weighing the pros and cons of running multiple concurrent mysqld's on one server, to have better control over what databases are on what physical disks. System: 4 processor sun box running solaris with eighteen 36Gb drives. The situation is that i have a bunch of databases on one server that can all be classified as either external use or internal use. The internal use databases are consistently hit pretty hard, and we want this to have minimal impact on the external use databases. Currently we're using 64 index MyISAM tables, and with carefully choosing mount points for various physical devices, we have the databases separated as we want them. It is my understanding that with InnoDB, all tables are put into the configured InnoDB file(s) together, which would violate what i am trying to accomplish. The only solution i have come up with to control the physical location of InnoDB databases is to run multiple mysqld servers, each one with its InnoDB files on the desired device. Has anyone experienced any success or failure with this sort of configuration?
View Replies !
View Related
MySQL Handling Heavy Loads
Has anyone used MySQL in a public web site environment that receives 1 - 1.5 million sessions/day? Sessions are mostly content and light commerce. Site spikes to 3 million sessions/day about 4 times/year. Trying to find a good example of MySQL holding up under this kind of load.
View Replies !
View Related
MySQL 4.0.13 Memory Problem Under Heavy Load
How to increase available/free memory and performance on a heavy volume database server. I have MySQL 4.0.13 running on RH 7.2 replicated to another RH 7.2 using same MySQL version. Recently our master database server (2 AMD Cpu + 2Gb memory + 2Gb swap space) started to suffer from memory outages because of heavy load. During day available free memory is changing from 200Mb to 5Mb and when available memory reaches to 5Mb MySQL starts to give 'Too many connections' messages. Db server is working with 45-70 query/second and more than 25,712 connection per hour. There are active 10-13 threads serving databases. To increase available free memory I've did the following : 1- Optimized all tables 2- Removed unneccessary/old indexes 3- Moved unused databases to replication server 4- Increased key_buffer_size from 8Mb to 128Mb 5- Have increased max_connection from 100 to 150 6- Have increased thread_cache to 5 This changes helped a bit but still memory is a problem for MySQL. What should I do to prevent 'too many connections' messages and have more memory available on database servers? Should I remove more indexes from tables? Should I increase key_buffer_size to 256Mb or more? Key_buffer_size doesn't look like a problem since key efficiency looks 100% most of the time.
View Replies !
View Related
MySQL 4.0.13 Memory Problem On Heavy Load
I want to get your opinions on how to increase available/free memory and performance on a heavy volume database server. I have MySQL 4.0.13 running on RH 7.2 replicated to another RH 7.2 using same MySQL version. Recently our master database server (2 AMD Cpu + 2Gb memory + 2Gb swap space) started to suffer from memory outages because of heavy load. During day available free memory is changing from 200Mb to 5Mb and when available memory reaches to 5Mb MySQL starts to give 'Too many connections' messages. Db server is working with 45-70 query/second and more than 25,712 connection per hour. There are active 13-18 threads serving databases. To increase available free memory I've did following : 1- Optimized all tables 2- Removed unneccessary/old indexes 3- Moved unused databases to replication server 4- Increased key_buffer_size from 8Mb to 16Mb This changes helped a bit but still memory is a problem for MySQL. Average MySQL thread used to consume 100-120 Mb memory before changes, now it is consuming 60-70Mb per thread. What should I do to prevent 'too many connections' messages and have more memory available on database servers? Should I remove more indexes from tables? Should I increase key_buffer_size to 32Mb or more? Key_buffer_size doesn't look like a problem since key efficiency looks 100% most of the time.
View Replies !
View Related
Mysql Version Is More Able To Handle Heavy Traffic
we are currently running mysql 4.1. we have problems with a php/mysql website that generates a lot of traffic and relies heavily on mysql (it's a "find your old schoolmates" community website). Sometimes it just says "too many connections", or just takes a long while before rendering the page. Would upgrading to mysql 5 help ? What are the best mysql settings in order to optimize the performance?
View Replies !
View Related
Mysql Heavy Load On Databases And Connections?
I'm preparing for a lot of potential traffic to a web app. My question is. Is there any restriction on the amount of databases you have on a single mysql installation on a linux server. Could there be any performance issue if for example I had 100,000 databases all being connected to at different times? What is the upper limits of a standard LAMP dedicated server? What i mean is how many simultaneous connection can it handle before it starts to slow down for the users?
View Replies !
View Related
Tuning In My.cnf
This is my currrrent config, i tried to tune it myself and ithas made great changes, But i don't think its correct... Code: [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock skip-innodb max_connections = 1000 key_buffer = 256M myisam_sort_buffer_size = 256M join_buffer_size = 64M read_buffer_size = 64M sort_buffer_size = 128M table_cache = 10000 thread_cache_size = 250 tmp_table_size = 64M wait_timeout = 1800 connect_timeout = 10 max_allowed_packet = 32M max_connect_errors = 10 query_cache_limit = 64M query_cache_size = 128M query_cache_type = 1 ithread_concurrency = 4 [mysqld_safe] err-log=/var/log/mysqld.log open_files_limit = 8192 [mysqldump] quick max_allowed_packet = 16M [myisamchk] key_buffer = 128M sort_buffer = 128M read_buffer = 32M write_buffer = 32M [mysql.server] user=mysql this is the server info.... Code: Processor #1 Vendor: GenuineIntelProcessor #1 Name: Intel(R) Core(TM)2 CPU 6320 @ 1.86GHzProcessor #1 speed: 1864.881 MHzProcessor #1 cache size: 4096 KBProcessor #2 Vendor: GenuineIntelProcessor #2 Name: Intel(R) Core(TM)2 CPU 6320 @ 1.86GHzProcessor #2 speed: 1864.881 MHzProcessor #2 cache size: 4096 KB 2 GB Ram
View Replies !
View Related
MySQL Enterprise Server With InnoDB For Mission-critical Data?
However recently the company I work for has the requirement to upgrade their database system. The data here really is mission-critical and we can't afford to loose any of it, and we need 24-7 uptime, with good performance (we have lots of clients so there'll be heavy load), any downtime will cost us. What I'd like to hear is peoples own experiences with MySQL Enterprise, good or bad, and if it's up to the job. Looking around the net I've seen lots of supposed expert DBAs saying that there's no argument; you should go with one of the "big 3", these being DB2, Oracle or MSSQL. However I get the feeling Oracle and DB2 would be a massive task to configure, and MSSQL - well it runs on Windows, we can't have any downtime no matter how good people say it is these days. So my idea was; InnoDB on 3 servers - a master and 2 replication slaves, with one slave off-site down a 10Mb line (wide enough pipe?). We use the on-site slave to run our daily backups, and point our reporting web sites at it too. the off site is for worst-case scenario disaster recovery. How much would we be better off spending more ÂŁ on one of the "big 3"? Would our data be safer on these? Would we get better performance with these? Is there a better model I could use for the MySQL setup?
View Replies !
View Related
Perfomance Tuning
I have just installed redhat linux 9 which ships with mysql 3.23.56. Mysql has to be setup so that it can use innodb tables, and data inserts (blobs) should be able to handle at least 8M at a time. The machine has two P III 933MHz CPU's, 1.128G RAM (512M*2 + 128M), and a 36 Gig hd with 1 Gig swap and 3 equal size ext3 partitions. What would be the recomended setup for good performance considering that the db will have about 15 users for 9 hours in a day, and about 10 or so users throughout the day who wont be conistenly using the db. My configuration looks like this so far: ++++++++++++++++/etc/mysql.cnf++++++++++++++++++++++++++++++++ [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock max_allowed_packet=16M #InnoDB innodb_data_file_path = ibdata/ibdata1:2000M:autoextend innodb_data_home_dir = /var/lib/mysql [mysql.server] user=mysql basedir=/var/lib [safe_mysqld] err-log=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid ++++++++++++++++/etc/mysql.cnf++++++++++++++++++++++++++++++++
View Replies !
View Related
Optimize And Tuning
i was reading a post from long ago, and suggest for better performance at the mysql server to check the queries adn then make an optimization. i have this db that's eating lots of resources, and usually reaches 90% for the cpu and almost everything is used by the mysql. i supposse it´s a matter of tuning vars, wich one would you suggest to tackle first, and what others next in an myisam engine
View Replies !
View Related
Performance Tuning For Inserts
i am inserting, usually, about 1-5 million records into a 50-350 million (depends on which DB i'm using) DB. The table has about 75 columns in it. I am getting, on average, processing time of about 6 seconds per thousand which is unacceptable. I need to speed this process up. Right now i am building a string in Java with "insert into <tableName> values(.......);" but I'm sure there's gotta be a faster way. Would it be faster to write all the additions to a seperate file and then load it using 'LOAD DATA LOCAL INFILE...'?
View Replies !
View Related
Monitor / Tuning Of MYSQL
Can anyone tell me of documention/tutorials/software for monitoring and or tuning MYSQL databases. We currently run something called foglight (Quest Software) which tracks and monitors our Oracle Instances (sends us emails about things). I think we can code stuff to monitor the MYSQL databases that we are due to take over at some point, however I am not quite sure what to look for.
View Replies !
View Related
Used Tuning Primer - Says: No Key Reads?
When I use Tuning Primer it tells me this: KEY BUFFER No key reads?! Seriously look into using some indexes Current MyISAM index space = 4 K Current key_buffer_size = 8 M Key cache miss rate is 1 : 0 Key buffer fill ratio = 0 % Your key_buffer_size seems to be too high. Perhaps you can use these resources elsewhere
View Replies !
View Related
Tuning MySQL To Beat MS Access
I use MS Access to analyze survey data and I'm hoping to migrate to MySQL. I'm currently running MySQL 4.1 on a Windows 2000 multi-function machine. The following query has one of the simplest structures I would ever use, so I'm using it as a speed test before using MySQL for my much more complicated SELECT queries (as many as 45 joins, mostly using the same tables as below): SELECT count(r.r_id) FROM (r INNER JOIN q ON r.q_id = q.q_id) INNER JOIN a ON r.a_id=a.a_id; Full SHOW CREATE TABLE and SHOW INDEX FROM output for these tables is below. MS Access runs this query in just under 2 seconds. At first, MySQL took about 20 minutes. Indexing the bejeezus out of everything got it down to about 6 minutes; running ANALYZE TABLE on everything got it down to 2.5 minutes; and switching all the tables from InnoDB to MyISAM (duh) knocked it down to 7 seconds. Code:
View Replies !
View Related
Used Tuning Primer( Optimizes MySQL Script) - Says: No Key Reads?
When I use Tuning Primer it tells me this: KEY BUFFER No key reads?! Seriously look into using some indexes Current MyISAM index space = 4 K Current key_buffer_size = 8 M Key cache miss rate is 1 : 0 Key buffer fill ratio = 0 % Your key_buffer_size seems to be too high. Perhaps you can use these resources elsewhere How do I enable key reads? I've searched everywhere for this.
View Replies !
View Related
InnoDB, Can't Create Table
I had error message "Can't create table *.frm (errno:121)" when I was trying to create an innoDB table in MySQL Server 4.0.15. I know that the reason is the .frm files was deleted by some one which left data files. Does anybody know how to report and repair this sort of error.
View Replies !
View Related
Table.innoDB Missing
I am a novice user of MySQL so please excuse my ignorance. I recently installed MySQL and have a third party tool using it to update data in a database. Recently it started creating erorr messages: table.innoDB missing Looking at the database in phpMyAdmin the table affected is marked as in use. Trying to get in reports the error again. This problem seems to have only affected 2 out of the three 3 tables. I have tried flushing the tables, restarting mysql, dropping the tables, restarting the computer and restoring from a backup and I still keep getting the same errors. I also did a search of my hard disk and found not one single *.innoDB file, so I suspect I am missing something fundamental.
View Replies !
View Related
InnoDB Table Questions
I have two questions 1) is there restrictions on how many InnoDB tables you can create in a single mysql database? & is there a configuration I should work on before creating the tables? 2) I was trying to create one table and it refuses to create properly and I cannot see what is wrong with the code. maybe someone could help me out, [MYSQL]CREATE TABLE `models` ( `models` varchar(25) NOT NULL, `created_by` int(6) NOT NULL, `creation_date` datetime NOT NULL, PRIMARY KEY (`models`), INDEX (`created_by`), FOREIGN KEY (`created_by`) REFERENCES users(`users_id`) ON UPDATE CASCADE ON DELETE RESTRICT, )ENGINE=InnoDB; [/MYSQL]
View Replies !
View Related
Table Type InnoDB
I am struggling a bit to get going with mysql and my tutorial works through InnoDB tables without a clear explanation of the setup. To date I have modified the /etc/my.cnf file. mysqld starts without complaining. I have modified my.cnf to include: innodb_data_file_path = /data/mysqldata/innodb_data/innodata:10M:autoextend innodb_data_home_dir= It turns out that logged in as a mysql user if I "use innodta' it mounts as a the database. So am I correct in assuming that identifying the tablespace name in innodb_data_file_path is the equivalent of 'create database <databaseName> with a MyISAM table? Also once having 'use innodata' I can issue a create tables command and then see <tablename>.frm .MYD, and MYI listed in the innodb_data directory. However when <tblename> was created I could not use the 'engine = innodb; ' as the last line of the create table sql statement without getting an error. This suggests that the table that I made without 'engine=innodb' is just the usual MyISAM based table. Right? Wrong? Huh? I think the documentation is a little lacking in this area as are two other MySQL books that I purchased
View Replies !
View Related
Creating Table Type Innodb
I am trying to create tables with type innodb. I created a database and all the tables of type ISAM. Now I am at the point of making relations and establish refrential integrity. For that ofcourse I have to change the tables in the Innodb type. I did that with the commad "alter table tablename type = innodb". Command runs fine but the table type doesnt change. I tried to create a new table of type innodb but its not working either. I dont know what the problem is. Do we have any command to enable the innodb property or what?
View Replies !
View Related
Sparse InnoDB Table To Use NULL?
If a varchar(20) column is not going to have a value at least half of the time, should it have a default value of NULL or NOT NULL? I will have a MySQL 4.1 InnoDB table with about 12 columns. 8 of these are going to be varchar(20). Usually only a few of these fields will be populated (but which ones are pretty random). The table will mostly be used for inserts, and around 200,000 inserts a month.
View Replies !
View Related
Altering Huge Innodb Table
I need to add an index to an Innodb table 110gb big. When I last tried it took forever and made the db unusable to visitors. My solution was to create another table with the same structure with the extra index and copy everything over with a php script. This is working so far but is taking a long time and still hitting the performance for visitors. Is my solution the best way or is there another?
View Replies !
View Related
What Type Is Each Table? (MyISAM Or InnoDB)
I'm have about 200 MySQL databases on my server. Each database has 114 tables. All of the tables SHOULD be InnoDB, but I've found a few that are MyISAM. I'm trying to write a perl script to give me a list of all the MyISAM tables. Is there any sort of select statement that will give me the table type? (MyISAM or InnoDB) The only way I can figure this out is doing a 'SHOW CREATE TABLE' on each table and then looking at the table type from there. It would be 1000 times easier if I knew a select statement that would give me just the table type.
View Replies !
View Related
Alter Table Tab Engine = InnoDB
I check the manual that alter table tab engine = InnoDB might cause unsafe result. So what is the the best way to alter a table engine quickly? In the manual, we have to say "auto_increment = xxx" what does this have to do with alter engine ? And also not all tables have a column that is auto_increment
View Replies !
View Related
Multi-Table Delete & InnoDB
I have a system where several tables have a foreign key referencing a main table. When deleting a main table entry, I was planning on having multiple delete statements for each table. However, I realized that I could use foreign key Constraints to handle the deletion of rows in the dependent tables. I have been using DBDesigner4 to visually design my database and I have used it for creating the initial db. I actually like it quite well and I've had good success with it so far. I've also been using SQLyog for additional access to data during development. Even though DBDesigner shows that my dependent tables have a foreign key, when looking at the create statement, it simply calls them INDEX. When looking at the same statement through SQLyog it calls the FK simply KEY. When looking at the foreign key constraints, it shows in the CREATE & ALTER statement calling the foreign key FOREIGN KEY and then adding the reference and ON DELETE info (such as cascade). So, my questions are these. First, should I delete the existing KEY and then ALTER the table and add the FOREIGN KEY & constraints OR can I simply alter the tables and add constraints to the existing KEY index? How important is it that I use the constraints as opposed to simply having delete statements for each table? Is it simply for efficiancy and speed? Code:
View Replies !
View Related
InnoDb Table Count Incorrect??
This is the error I get as a warning in phpMyAdmin when I have removed a row from a table. Am I doing something wrong? 3.11 The number of records for InnoDB tables is not correct. phpMyAdmin uses a quick method to get the row count, and this method only returns an approximate count in the case of InnoDB tables. See $cfg['MaxExactCount'] for a way to modify those results, but this could have a serious impact on performance.
View Replies !
View Related
Order Of Fields In InnoDb Table
During my extensive reading a couple of weeks ago,I read that MySQL tables should have their fields in a specific order.All the foreign keys should be first followed by the 'hard data' fields. explain if this is, in fact,necessary and, if so, why.I can't recall where I read it or I would go back there again. said it should be like this: unique_id | business_id | address_id | first_name | last_name | 00001 | 00005 |00003 | Joe | Soap |
View Replies !
View Related
Count Is Wrong For Innodb Table
I'm running a mysql database using innodb. When I use phpmyadmin to browse records of certain tables, the count keeps changing on me for some reason: Showing rows 0 - 29 (12,340 total, Query took 0.0003 sec) The "12,340" count would sometimes go up, and sometimes go down. It never stays the same. Is there a problem with my database? I can' figure this out. It shouldn't be doing this should it?
View Replies !
View Related
Lookup FK Info On MyISAM And InnoDB Table
I'm wondering if there is a way to retrieve Foreign Key declaration information on both MyISAM and InnoDB tables. Of course, I understand that MyISAM doesn't support Foreign Keys, however, it does still parse FK declarations within a CREATE TABLE statement, and moreover, it even creates an index on the column that is the Foreign Key. So my question is for this sample CREATE TABLE declaration: CREATE TABLE table_name ( id INT NOT NULL AUTO_INCREMENT, other_id INT NOT NULL, PRIMARY KEY (id), FOREIGN KEY (other_id) REFERENCES other_table (id)) TYPE = InnoDB --- OR --- TYPE = MyISAM ; Can I get the Foreign Key information (meaing, the table and the column that a FK is keyed to) from MySQL? Doing a "DESC table_name" or "SHOW KEYS FROM table_name" indicates that the FK column is Indexed, but doesn't really give much more information other than that. The only way I seem to be able to get *some* sort of FK info is if i do a "SHOW CREATE TABLE table_name" (and even so, this only works on InnoDB tables. For MySQL tables, it will show my foreign key declaration as just a simple index).
View Replies !
View Related
Alter Table Type MyISAM To INNODB
I've got a table with ~250k rows. When I try to alter it's type from MyISAM to INNODB, it just sit's on 'copying to tmp table' for an obscene length of time, until I eventually kill it. I've done it to a few 150k row tables with no problem. Takes about 5-10 seconds. I then found another table with a similar row count, was able to alter it without a problem. But it was smaller in size. So found one bigger, with double the rows, and 10mb larger.... And still, it worked.
View Replies !
View Related
Custom InnoDB Table Space In Windows
In Windows, there are lots of config files for MySQL. When installing MySQL, the config wizard created a single, autoextending ibdata1 file for InnoDB tablespace. However, I want to customize the tablespace. Instead of innodb_data_file_path = ibdata1:10M:autoextend I would like to have something like this innodb_data_file_path = ibdata1:650M;ibdata2:650M;ibdata3:650M But when I make this change in the file my-innodb-heavy-4G.ini the server fails to start. How can I change the default config for InnoDB and customize it to my needs?
View Replies !
View Related
|