Unix Technical Forum

Innodb and auto_increment; BDB engine?

This is a discussion on Innodb and auto_increment; BDB engine? within the MySQL forums, part of the Database Server Software category; --> Since I'm redesigning my DB I wanted to switch to Innodb tables, yet Innodb doesn't allow for auto_increment on ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 10:54 AM
wyo
 
Posts: n/a
Default Innodb and auto_increment; BDB engine?

Since I'm redesigning my DB I wanted to switch to Innodb tables, yet
Innodb doesn't allow for auto_increment on secondary primary key
columns. Is there a workaround this problem?

>From the docs the BDB engine should support auto_increment on

secondary primary key columns and transactions. Yet it seems BDB isn't
used very much. Does anybody have experience with the BDB engine?
Performance numbers?

O. Wyss

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 10:54 AM
lark
 
Posts: n/a
Default Re: Innodb and auto_increment; BDB engine?

== Quote from wyo (otto.wyss@orpatec.ch)'s article
> Since I'm redesigning my DB I wanted to switch to Innodb tables, yet
> Innodb doesn't allow for auto_increment on secondary primary key
> columns. Is there a workaround this problem?
> >From the docs the BDB engine should support auto_increment on

> secondary primary key columns and transactions. Yet it seems BDB isn't
> used very much. Does anybody have experience with the BDB engine?
> Performance numbers?
> O. Wyss


If you'd like to have access to row level locking and transaction processing, then
Innodb is a good choice for you. Innodb provides some other nice features as well
but these two are the primary features of it.
--
POST BY: PHP News Reader
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 10:55 AM
Willem Bogaerts
 
Posts: n/a
Default Re: Innodb and auto_increment; BDB engine?

> ..., yet
> Innodb doesn't allow for auto_increment on secondary primary key
> columns.


Sorry, I don't understand what you are trying to say. Could you give an
example?

Best regards,
--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 10:55 AM
wyo
 
Posts: n/a
Default Re: Innodb and auto_increment; BDB engine?

On May 25, 9:01 am, Willem Bogaerts
<w.bogae...@kratz.maardanzonderditstuk.nl> wrote:
> Sorry, I don't understand what you are trying to say. Could you give an
> example?
>

CREATE TABLE Attribute (
ID INT NOT NULL,
SubID INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (ID, SubID),
);

This isn't allowed with InnoDB while MyISAM and according to the docs
BDB does. "SubID" may not use "AUTO_INCREMENT".

O. Wyss

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-28-2008, 10:55 AM
Willem Bogaerts
 
Posts: n/a
Default Re: Innodb and auto_increment; BDB engine?



>> Sorry, I don't understand what you are trying to say. Could you give an
>> example?
>>

> CREATE TABLE Attribute (
> ID INT NOT NULL,
> SubID INT NOT NULL AUTO_INCREMENT,
> PRIMARY KEY (ID, SubID),
> );
>
> This isn't allowed with InnoDB while MyISAM and according to the docs
> BDB does. "SubID" may not use "AUTO_INCREMENT".


I see. You can make SubID the primary key (if you want to) and define a
unique index for the compound key:

CREATE TABLE Attribute (
ID INT NOT NULL PRIMARY KEY,
SubID INT NOT NULL AUTO_INCREMENT,
UNIQUE INDEX (ID, SubID)
);


--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:50 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com