Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




InnoDB Tables And MyISAM Tables In ONE Database?


My application demands some advantages from InnoDB and some from MyISAM.

Is it attainable to have both InnoDB tables and MyISAM tables in ONE database?
Or else, getting views from two databases, one from InnoDB and the other from MyISAM?

If not possible, any other approaches will do the job?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Differance Between InnoDB And MyISAM Tables ?
can anybody tell me the differance between the innidb and myisam tables
types .

Mixed MYISAM-INNODB Tables
Our main db was built and designed with standard MYISAM tables. So far, so good. Somewhere along the line, one of our past developers snuck some INNODB tables into the db. When I attempted to bring up a test server for a new developer using a dumped copy of the db, MySQL chokes on the first idb table when attempting to import it. What am I missing?

Differance Between InnoDB And MyISAM Tables ?
can anybody tell me the differance between the innidb and myisam tables
types .

Changing Tables From MyISAM To InnoDB
I have a database with about 20 or so tables, maybe a few thousand rows
in each. I am starting to do more complex things with my insertions etc,
and I want to start to use transactions, so I imagine I should change
some table types in the database from MyISAM to InnoDB.

I know that InnoDB tables are a completely different beast than MyISAM in
terms of data storage etc... ie: instead of using folders on the server,
everything is stored in a file (ibdata1).

Is there anything I should be aware of when changing a bunch of tables
from MyISAM to InnoDB? Any hidden gotchas like changing 'ibdata1' in any
way, table slow downs, index changes, or ANYTHING? Or can I just alter
the tables and go on my merry way?

Something tells me I need to start learning a bit more about that ibdata1
file.... is there a size limit or anything? It seems to me that because
MyISAM stores its data in directories on the server, that accessing the
data would be much quicker. Having all my data in that one file seems
like it would slow things down... does it?

Differences Between Myisam And Innodb Tables
what is the difference between myisam and innodb tables ??
And why is there a comment "innodb free: 4096 kb" since I have changed my
tables from myisam to innodb?
Is this working like Sybase, where you need to create devices for data
storage, or do I miss the idea completely here?

Differance Between InnoDB And MyISAM Tables
can anybody tell me the differance between the innidb and myisam tables
types .

New Database -- 'can't Fetch' Innodb Tables
After migrating my tables in from Access, I cleaned them up and had them working well in innoDB.  But now I can't open them through MySQL Administrator.  I can view the table names (in red); I can create a new innoDB table (and behold it can be found as a .frm with the others); but when I try to view existing tables I get the error,

Quote: MySQL Administrator Exception:
Cannot fetch table information.

MyISAM Versus INNODB Database Recovery?
I'm currently using MyISAM as the database engine for my CUSTOMER Table because several of the fields are used to create a FULLTEXT index (and MyISAM is the only engine that supports FullText.)

I'm somewhat concerned though with using MyISAM as the production database engine for the CUSTOMER table because of the potential for loss of data due to a database crash and I can not lose any data. InnoDB seems that it has better recovery capabilities. This is my first MySQL production database, so I'm only going on what I read from the manual vs. actual experience.

I've thought about splitting the CUSTOMER Table so that the FullText columns are implemented in one table in the MyISAM engine, and the other columns containing critical customer information are implemented in the InnoDB engine.

I don't like this approach as well because now I need to keep the primary keys in synch + I will need to do joins on most queries. However, potential loss of data is the greatest risk I need to protect.

How Can I Tell If My Tables Are MYISAM Tables Or What?
Is there a MySQL commad to determine what table type existing tables in a
database are?

HotBackup For MyISAM Tables?
Is there something like HotBackup for MySQL InnoDB tables, for MyISAM
tables? I'm using MyISAM tables for some of my tables because I needed
FullText search.

Making All Tables MyISAM
Is there a way to specify MyISAM for all tables in a given file rather
than having to specify it at the end of each table declaration. I think
this would make porting databases back and forth to MySQL somewhat easier
since including MyISAM as part of the table declaration is not compatible
with standard SQL syntax, so I would like to keep MySQL-specific stuff
separate from the rest of the SQL DDL file.

Temp Tables/Myisam
Deleted made a new topic that explained it much better

Speeding Up Large MySQL MyISAM Tables
I'm somewhat new to MySql. I've been using it for a while, but pretty much
out of the box setup, and am starting to suffer heavily with my larger
tables. I have a table with 5,000,000+ rows that I have to search and do
joins on. Although I have an index set up for it, the joined select will
still take some 400+ seconds to return, which is obviously unacceptable.
This is due to enormous HD access.

Perhaps someone can help me with indexes here; I was under
the impression that the index for the tables are cached in memory, and
therefore permitted "instant" searchability, without having to retrieve data
from each of the rows of the DB. Is there a startup parameter, or
something in the mysql.ini file, that must be set to allow for this? I have
the index configured properly, and have made sure that the query uses there
parameters in the where clause in the same order that they appear in the
index. Code:

Innodb Tables
I'm new to Unix and Mysql and I can't seem to get my innodb tables up and running.

My.cnf file looks like this:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysql.pid

I tried copying the portion of the my-medium.cnf that deals with innodb and putting it under the [mysqld] part but I got the can;t connect to socket error.

Copying InnoDB Tables
When using MyISAM tables, all the data and structure files are contained in the one directory - c:mysqldatamydatabase1, for instance. This means that to copy the files from one PC to another is easy.

However, if using InnoDB tables, you have the ibdata1, ib_logfile0 etc. in the c:mysqldata directory, which presumably contain data for all the tables in all the subdirectories.

As a developer, I often want to copy databases and data from clients so that I can work on them directly, but having combined data files would appear to make this impossible, since my overall database will be different from theirs.

Have I missunderstood how the ibdata1, ib_logfile0 etc. work, or is there a simple way to copy InnoDB data files? I have found reference to this on the MySQL site and forums, but nothing that addresses this particular issue.

Enableing InnoDB Tables
I am running SuSE 9.0. I have installed, MySql 4.0.15. Apparantly versions
4.0 and above are supposed to come with InnoDB tables already enabled, this
is not the case with mine, the have_innodb variable is at NO.

I edit the my.cnf file to include the following as per mysql manual

innodb_data_file_path = ibdata1:10M:autoextend
set-variable = innodb_buffer_pool_size=70M
set-variable = innodb_additional_mem_pool_size=10M
set-variable = innodb_log_file_size=20M
set-variable = innodb_log_buffer_size=8M
innodb_flush_log_at_trx_commit=1

However when I try and start mysqld up again I get error messages saying
that all the variables are not recognised. These variables are mentioned
again and again in help files to enable innodb tables in MySql.

Apache2triad 1.2 - InnoDB Tables
I am using Apache2triad 1.2 as local development environment. It is
working fine, but I cannot create InnoDB tables with the phpMyAdmin
2.5.6 included in this package.

According to the my.ini file (see below) some lines in this file must
be commented or uncommented to use innoDB. If I do this, the mySQL
server does not start any more. Code:

Innodb Tables In FreeBSD?
I'm creating some tables similar to this:

CREATE table clients (
client_id int(10) unsigned NOT NULL auto_increment,
birthdate date NOT NULL default '0000-00-00',
lastname char(15) NOT NULL,
firstname char(15) NOT NULL,
PRIMARY KEY (client_id),
KEY birthdate(birthdate)
);

Then I run mysqldump to see what was created. In windows I get:

ENGINE=InnoDB DEFAULT CHARSET=latin1;

but in FreeBSD I get:

ENGINE=MyISAM DEFAULT CHARSET=latin1;

How can I caulse FreeBSD to default to InnoDB tables also? I can't find a configuration file to see if I can change the default.

Myiasm Vs. Innodb Tables
I'm not sure why or when you would use an Innodb table vs. a MYISAM table. Can someone tell me when and why you would use one vs. the other?

Creating Innodb Tables
I created table like this:

CREATE TABLE `user` (
`username` VARCHAR(30) NOT NULL,
`password` VARCHAR(30) NOT NULL,
`userlevel` INT NOT NULL,
PRIMARY KEY ( `username` )
) TYPE=INNODB;

this is clearly setting the table as innodb.

Cannot Browse Data In InnoDB Tables
At present, I am using MySQL version 5.0.20 which I update via my spring application. Inside my configuration file I recently changed from: <property name="dialect">org.hibernate.dialect.MySQLMyISAMDialect</property> to <property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>. I did this because I wanted my transactions to rollback if they were not commited properly. However the problem I am now having is that I cant view the data inside my InnoDB tables (via my phpMyAdmin page). Whenever I click on the 'browse' button I get the following message: "MySQL returned an empty result set". However, I know data is inside the tables because the 'browse' button is not dissabled. If there is no data in the tables the button become dissabled.

NOT NULL Fields In INNODB Tables
My database is composed of INNODB tables such as...

CREATE TABLEuser
(
nameVARCHAR(255)NOT NULL

) TYPE = INNODB;

The NOT NULL qualifier doesn't work as I would expect. While it
doesn't allow me to do this:

insert user values (null);

It will let me do this:

insert user values ("");

I appreciate that one could argue that "" is different to NULL and
therefore there is nothing wrong with this behaviour. However, surely
there is no defending the following (which is also allowed):

update user set name=NULL;

Is there any way that I can prevent users from setting a field to NULL
or ""? I am running version 4.0.17-nt on Windows XP

Row Level Locking With InnoDB Tables
I am relatively new to MySql (4.0.14) but I have read through the relevent
documentation and am still confused about how row level locking behaves
with InnoDB tables.

I created a database with a single innodb table which has 2 columns, one
of which is indexed. The locking behavior I see when I test against this
database is that it uses row level locks if the "SELECT ... FOR UPDATE"
involves the indexed column, but uses table level locks if instead it
involves the non-indexed column.

For example, if I have 2 mysql clients that perform the following operations:

client1> set autocommit=0;
client1> begin;
client1> SELECT my_column FROM my_table WHERE my_column = 1 FOR UPDATE;
client2> set autocommit=0;
client2> begin:
client2> SELECT my_column FROM my_table WHERE my_column = 2 FOR UPDATE;

The above query by client2 will block if the column in question is not
indexed, implying that client1 has somehow locked the entire table, even
though client1 and client2 are selecting different rows.

Am I misconfiguring something, or does InnoDB simply only support row
level locking when you are selecting indexed rows?

NOT NULL Fields In INNODB Tables
My database is composed of INNODB tables such as...


CREATE TABLEuser
(
nameVARCHAR(255)NOT NULL

) TYPE = INNODB;


The NOT NULL qualifier doesn't work as I would expect. While it
doesn't allow me to do this:

insert user values (null);

It will let me do this:

insert user values ("");

I appreciate that one could argue that "" is different to NULL and
therefore there is nothing wrong with this behaviour. However, surely
there is no defending the following (which is also allowed):

update user set name=NULL;

Is there any way that I can prevent users from setting a field to NULL
or ""?

Mysqldump And Restore Of Innodb Tables
We are on MySQL 4.0.21 on linux. We use InnoDB tables and foreign key
constraints extensively. The mysqldump backs up the database tables in
alphabetical order with foreign key constraints defined in the create
statement of each table. These foreign key constraints are violated at the
time of restore. We have tried the following two solutions...

(1) We have tried to backup the database tables in the order of their
dependencies. This works but the backup scripts need to be constantly
maintained as new tables are added/removed from the database.

(2) phpMyAdmin export does the database dump and puts the table constraints
as ALTER statements at the end of the dump. Unfortunately, the phpMyAdmin
dumps cannot be automated to the best of my knowledge.

Does anyone have a solution/script to backup databases with InnoDB tables
such that constraints will not be violated at the time of restore.

100 Databases, 4 Tables Each, Or 1 Database, 400 Tables
I was able to build, tweak and do whatever necessary to establish a rather different project but am worried that it may sooner or later crash due to idiotic programming / database usage.

In essense I took 1 database with 4 tables and duplicate it 100 times BUT because I need to connect to the different tables within the php script and am not experienced enough to created nested database connections, I duplicate the 400 tables within the same database.

What I want to know from a MySql perspective, would it make any difference if the script "play around" with 1 database connection and 400 tables or would 100 databases with 4 tables each be better? (Maximum database queries to only 17 tables at a time)

Speed Of InnoDB DELETEs On Large Tables
I am finding delete queries on large InnoDB tables very slow - are
there ways to speed this up?

I have a table with about 100 million rows:

I am trying to delete just a few of these rows (the following select
takes a couple of seconds):
[color=blue]
> SELECT count(*)[/color]
-> FROM UserSnap
-> WHERE LogDate<now() - INTERVAL 750 DAY;
+----------+
| count(*) |
+----------+
| 308969 |
+----------+
[color=blue]
> DELETE FROM UserSnap WHERE LogDate<now() - INTERVAL 750 DAY;[/color]

That delete query takes hours to run. The structure of the table is:
[color=blue]
> desc UserSnap;[/color]
+----------+-------------+------+-----+---------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------------------+-------+
| LogDate | datetime | | PRI | 0000-00-00 00:00:00 | |
| Period | tinyint(4) | | PRI | 0 | |
| UserName | varchar(50) | | PRI | | |
| RateType | varchar(50) | | PRI | default | |
| Rate | float | YES | | NULL | |
+----------+-------------+------+-----+---------------------+-------+

Any suggestions on why this is slow, and what to do about it?

Can't Open File Error For Innodb Tables
I enabled/initialized innodb for my MySql database using innodb_data_file_path = ibdata1:10M:autoextend in my.cnf

i created tables.. but some tables(the rest are working fine) when i try tp access them is giving meCan't open file: tablename.InnoDB'. (errno: 1)

Question About Row Level Locking With InnoDB Tables
I am relatively new to MySql (4.0.14) but I have read through the relevent
documentation and am still confused about how row level locking behaves
with InnoDB tables.

I created a database with a single innodb table which has 2 columns, one
of which is indexed. The locking behavior I see when I test against this
database is that it uses row level locks if the "SELECT ... FOR UPDATE"
involves the indexed column, but uses table level locks if instead it
involves the non-indexed column.

For example, if I have 2 mysql clients that perform the following operations:

client1> set autocommit=0;
client1> begin;
client1> SELECT my_column FROM my_table WHERE my_column = 1 FOR UPDATE;
client2> set autocommit=0;
client2> begin:
client2> SELECT my_column FROM my_table WHERE my_column = 2 FOR UPDATE;

The above query by client2 will block if the column in question is not
indexed, implying that client1 has somehow locked the entire table, even
though client1 and client2 are selecting different rows.

Am I misconfiguring something, or does InnoDB simply only support row
level locking when you are selecting indexed rows?

Best Way To Deal With Linking Tables And Foreign Keys When InnoDB Is Not An Option.
Title covers most of it.

On database insertion I suffer from a lack of transactions, which means I can enter the data into the primary database, then have the database fail with exactingly bad timing and fail when I am making my entries in other tables or the linking table.

On data deletion I suffer from a lack of foreign key constraints so again the database can fail after I delete my entry from my main table, but before I enter the data for my linking tables.

My biggest conern is that I end up with data in the linking tables but not in the main table. Then if I tried to re-enter that main entry with those linking table entries I would get an error due to duplication of the primary key (concacted id of the two foreign keys) in my linking table.

I am considering elaborate if loops in my php to try and catch errors and delete the whole entry if the errors occur. The problem being that the errors will occur when the database is misbehaving so my odds that the delete will work might be somewhat low.

Has anyone else had to work withou InnoDB much in scenarios like this?

Myisam Or Innodb
Is there a way to show what type of a storeage engine a table is using from the mysql monitor?

The Age-old MyISAM Vs InnoDB
Okay, someone help me out here. I want to see some numbers supporting the omnipresent claim that MyISAM tables are faster than InnoDB tables. I don't want to hear "MyISAM is the best because it's faster"; Google gave me over 100,000 links to pages that say that. I want to see numbers, results from benchmarking. I'm well aware of the difference in features between the two engines (transactions, referential integrity, full-text indexing, etc), I'm simply interested in seeing support for the claims of speed superiority the MyISAM crowd are always quick to shout. I'll start:

http://www.mysqlperformanceblog.com/...hmarks-part-1/
This is the only set of data I could find comparing InnoDB and MyISAM, and shows in general InnoDB demonstrating superior performance over MyISAM. This test was done exclusively on SELECT statements, where MyISAM allegedly dominates InnoDB hands down.

In my own (admittedly limited) testing, again solely on SELECT statements using a mixture of indexed and non-indexed columns in WHERE, ORDER BY, and GROUP BY columns, and even tossing in a few aggregate functions just for fun, InnoDB and MyISAM were virtually neck-in-neck, with InnoDB never eeking out more than a 20% lead and MyISAM never returning faster at all. (Average InnoDB lead: 2.8%, statistically insignificant and putting it well within the realm of possibility that my observation that InnoDB was always faster was nothing more than a fluke.)

Innodb And Myisam
what are difference characteristics between inodb and myisam?

InnoDB Or MyISAM?
I'm having a tough time on how to choose a table type in my database design.

I am designing a multi-user web application and want to take advantage of both transactions and full text searching. However, as you know, I can only choose InnoDB for transactions or MyISAM for full text indexing/searching.

How do you guys go about deciding which to choose from? I've thought about using different types in different tables, to suit my needs. However, all data is dependent on each other. This means if I set table A to InnoDB, and table B to MyISAM, future transactions wouldn't work properly if I had to delete/update to both tables at once.

Innodb Or MyISAM ?
I have been reading a lot about Innodb and MyISAM recently. MyISAM offers speed whereas Innodb offers reliability. MyISAM is fast but with no transactions support, Innodb has certain, but very important limitations.


The InnoDB which makes it fast for INSERTs, UPDATEs and DELETEs while MyISAM offer the best performance for SELECTs.


so my doubt here which is best MyISAM or Innodb.Can I use Both engines in a
single table and How Innodb handles foreign key constraints and how Myisam handles fulltext indexes.if we apply both in a single table.what is the sysntax for doing like this

Innodb Vs Myisam
hi every one i am working on a database for a website, and just want to know how faster will be myisam from innodb if you please can tell me in percentage if you want to look at the design of the database i had it on this

InnoDB Vs MyISAM
I wonder witch one is best? What is the differance? Witch one is faster in witch case?

I hope someone can take littel time to answer me about these two database motors.

MyIsam DB To InnoDB...
How do I convert my existing database, which I'm using MySQL ver 4 for Windows and MyISAM table type to store the data, to the new format – InnoDB, without problem (
losing data...)

InnoDb -v- MyISAM
I have three tables one of which is a ManyToMany table.

tbl_Groups
Group_ID | Group_Name

tbl_Premises
Premises_ID | Premises_Name

m2m_GroupsPremises
Group_ID | Premises_ID

can the two tbl's be made with MyISAM and the m2m be made with innoDb or must they all be innoDB? I wonder if only those with a foreign key need to be built with InnoDb.

MyIsam -v- InnoDB
What is the view of the panel on this one? I suspect that there may be trade-offs but, I welcome your experience-based opinions.

InnoDB Vs. MyISAM
I'm making a database with about 20 tables, each once with many rows (ranging from 1000 to 100,000 from table to table) and it needs to be quick for updates and selects. I'm confident that I can arrange the tables and keys in a manner which provides me with good speed, however I cannot decide on which database to use.

I read some documentation that said that InnoDB was best for a web server (where the database is hosted) for transactions. However each user only ever performs a single action at a time (although many users are online simultaniously). The only times I need to lock and tables or records are for backups and maintenance, which I will do inside the user code anyway. With that information can anyone help me to determine which would be the best database, InnoDB or MyISAM?

InnoDB Vs MyISAM
I'm looking at what tables to use in my database and am thinking innodb will be better as it allows foreign keys however I was just wondering how much faster myISAM tables are?  

My table will probably have around 500,000 records...

Any thoughts / advice?

MyISAM Vs. InnoDB
I'm designing an event registration web application and have created a database on our UNIX web hosting server using MySQL 4.1. I need to join several tables using a registration ID.

My question: What is the best table design method to use - MyISAM or InnoDB?

MyIsam V Innodb
I am working with a test database. Originally the tables were all innodb. I have a number of queries involving and I had performed a certain amount of optimisation to ensure that the queries were using the correct indexes and were not performing a table scan.

I then changed the table type to MyIsam because I wanted to speed up the application and I do not require that the database is transaction-safe. However when I ran the same EXPLAIN on the exact same queries as before, I noticed that the queries were going to take significantly longer to run, depsite the fact that they were still going to use the correct indexes.

I have reviewed the documentation and cannot find anything of this nature. I was totally surprised because I expected MYISAM to speed up the queries.

MyISAM Vs. InnoDB
I've been having some problems with the .myi files, (the index files), of my MyISAM tables dissapearing. It can be fixed by restarting the server but I cannot figure out what is causing the problem.

So, in looking for a solution I started reading about different table types and realized that I will not be able to use MyISAM tables for some transactional stuff that I am about to build.

This led me to wonder - should I just change all my tables to InnoDB - I'll be able to do transactions and maybe I won't have problems with .myi files dissapearing!

So, here's my dilemma - the MySQL manual is contradictory about why I should not use InnoDB tables - in one place it says it's slow because it's transactional, but in another it says it is the fastest disk-based engine in existence.

Finally the real question: Is there any reason I should not switch to all InnoDB tables? Are they really super fast yet support both transactions and foreign key constraints?

Innodb Vs MyISAM?
Besides transaction capability, is there anything else about innodb
tables that makes it superior to myISAM?

I really don’t need transactions, but for example, I need superior
reliability for index (too many index corruptions in the past). Is
innodb better in that area, or any other areas?

InnoDB Vs MyISAM
Is there a matrix or chart that identifies the differences between InnoDB and MyISAM as well as highlighting any advantages and disadvantages?

Using MyISAM And InnoDB
How I can know that my database uses MyISAM or InnoDB storage engine? What command can be issued to check this?

INNODB Or MyISAM
what table type
to choose: MyISAM or INNODB?

I need a referential integrity to be
checked, so – I know – INNODB
is the only choice, at least now.
But what are the costs? Why –
in general, not only when talking
about RI – INNODB is better than
MyISAM?


Copyright © 2005-08 www.BigResource.com, All rights reserved