().
Best,
/ Carsten
On 08-10-2015 15:48, Richard Reina wrote:
If I insert a record into a table with an auto increment ID how can I get
that records ID value? I have read about SELECT LAST_INSERT_ID() statement,
however, do not two statements introduce the risk that another insert may
occur
If I insert a record into a table with an auto increment ID how can I get
that records ID value? I have read about SELECT LAST_INSERT_ID() statement,
however, do not two statements introduce the risk that another insert may
occur in the interum? Is there a full proof way of getting the ID
From: rounak jain rounak.m...@gmail.com
I have a table which needs two fields with auto-increment.
I don't know if you have such control over your installation, but you might
consider the work-alike MariaDB, which I believe supports auto-increment on
multiple fields, as well as a slew
refer to http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html
On Sun, May 12, 2013 at 9:39 AM, rounak jain rounak.m...@gmail.com wrote:
I have a table which needs two fields with auto-increment.
I have the found the answer here:
http://stackoverflow.com/questions/13642915/mysql
are reported on the slave.
-Hank Eskin
On Wed, Jun 15, 2011 at 4:38 PM, Hank hes...@gmail.com wrote:
This is a follow-up to my previous post. I have been narrowing down
what
is causing this bug. It is a timing issue of a replication ignored
table
with an auto-increment primary key
causing it. I plan to write it up tomorrow and
post it.
Basically, everything works perfectly, until I add a
replication-ignore-table=xxx statement in my.cnf where xxx is a
different table with a unique id INT auto-increment as the single primary
key And then the values being inserted
This is a follow-up to my previous post. I have been narrowing down what is
causing this bug. It is a timing issue of a replication ignored table with
an auto-increment primary key values leaking over into a non-ignored table
with inserts immediately after the ignore table has had rows inserted
are reported on the slave.
-Hank Eskin
On Wed, Jun 15, 2011 at 4:38 PM, Hank hes...@gmail.com wrote:
This is a follow-up to my previous post. I have been narrowing down what
is causing this bug. It is a timing issue of a replication ignored table
with an auto-increment primary key values
...@gmail.com wrote:
This is a follow-up to my previous post. I have been narrowing down what
is causing this bug. It is a timing issue of a replication ignored table
with an auto-increment primary key values leaking over into a non-ignored
table with inserts immediately after the ignore
15, 2011 at 4:38 PM, Hank hes...@gmail.com wrote:
This is a follow-up to my previous post. I have been narrowing down
what
is causing this bug. It is a timing issue of a replication ignored
table
with an auto-increment primary key values leaking over into a
non-ignored
table
down
what
is causing this bug. It is a timing issue of a replication ignored
table
with an auto-increment primary key values leaking over into a
non-ignored
table with inserts immediately after the ignore table has had rows
inserted.
Basically, data from the ignored table
master, and this bug appears on both 5.5.11 and
5.5.8
32 and 64-bit slaves (statement based replication).
I'm finding an auto-increment field (part of a compound primary key)
updates
correctly using null to insert the next value on the master.. but
when
this statement is replicated
5.5.11 and
5.5.8
32 and 64-bit slaves (statement based replication).
I'm finding an auto-increment field (part of a compound primary key)
updates
correctly using null to insert the next value on the master.. but
when
this statement is replicated on the slaves, instead of inserting
2011/06/13 22:38 -0400, Hank
But that bug report was closed two years ago. I have no idea if it's the
server sending bad data or the slaves. I think it's the slaves, because on
the slave error, it clearly is getting this statement: insert into test
values (1,null) to replicate, but when it is
, until I add a
replication-ignore-table=xxx statement in my.cnf where xxx is a
different table with a unique id INT auto-increment as the single primary
key And then the values being inserted into the test table (above, not
ignored) represent the last-insert-id of the replication *ignored* table
Hello All,
I have a 64bit, 5.5.8 master, and this bug appears on both 5.5.11 and 5.5.8
32 and 64-bit slaves (statement based replication).
I'm finding an auto-increment field (part of a compound primary key) updates
correctly using null to insert the next value on the master.. but when
a 64bit, 5.5.8 master, and this bug appears on both 5.5.11 and
5.5.8
32 and 64-bit slaves (statement based replication).
I'm finding an auto-increment field (part of a compound primary key)
updates
correctly using null to insert the next value on the master.. but when
this statement is replicated
On Jun 14, 2011 3:07 AM, Hank hes...@gmail.com wrote:
Hello All,
I have a 64bit, 5.5.8 master, and this bug appears on both 5.5.11 and
5.5.8
32 and 64-bit slaves (statement based replication).
I'm finding an auto-increment field (part of a compound primary key)
updates
correctly
.
Claudio
On Jun 14, 2011 3:07 AM, Hank hes...@gmail.com wrote:
Hello All,
I have a 64bit, 5.5.8 master, and this bug appears on both 5.5.11 and
5.5.8
32 and 64-bit slaves (statement based replication).
I'm finding an auto-increment field (part of a compound primary key)
updates
Should it be null?
INSERT INTO `friendlyCMS`.`log` (`idlog`, `imepriimek`, `clock`,
`action`, `onfile`, `filesize`) VALUES (NULL, $_COOKIE['user'],
CURRENT_TIMESTAMP, 'saved',$filename, filesize($filename));
idlog is primaryk ey auto inrement not null...
When insertin the value what should I pass
when INSERT for auto increment]
Should it be null?
INSERT INTO `friendlyCMS`.`log` (`idlog`, `imepriimek`, `clock`,
`action`, `onfile`, `filesize`) VALUES (NULL, $_COOKIE['user'],
CURRENT_TIMESTAMP, 'saved',$filename, filesize($filename));
idlog is primaryk ey auto inrement not null...
When
To: mysql@lists.mysql.com
Sent: Monday, 16 May, 2011 4:49:43 PM
Subject: [setting value when INSERT for auto increment]
Should it be null?
INSERT INTO `friendlyCMS`.`log` (`idlog`, `imepriimek`, `clock`,
`action`, `onfile`, `filesize`) VALUES (NULL, $_COOKIE['user'],
CURRENT_TIMESTAMP, 'saved',$filename
Dear all,
I have an auto-increment column in Mysql database table. Let's say the
column has below values :
1
2
3
4
5
6
7
8
9
10
Now if i deleted some rows where id= 3 ,5 and 8
The data look like as :
1
2
4
6
7
9
10
I want to have it id's as
1
2
3
4
5
6
7
and next data is inserted right
On 09/02/2011 11:41, Adarsh Sharma wrote:
Dear all,
I have an auto-increment column in Mysql database table. Let's say the
column has below values :
1
2
3
4
5
6
7
8
9
10
Now if i deleted some rows where id= 3 ,5 and 8
The data look like as :
1
2
4
6
7
9
10
I want to have it id's as
1
2
* there are bookmarks out there
* they NEVER should point to another product what costs 5.000 $ as sample
in no rdbms auto_increment values are reused and if than
you have found a hard bug
Am 09.02.2011 12:41, schrieb Adarsh Sharma:
Dear all,
I have an auto-increment column in Mysql database table
From: Adarsh Sharma adarsh.sha...@orkash.com
I have an auto-increment column in Mysql database table. Let's say the column
has below values :
I'll echo what others have said.
Auto-increment is typically used to generate unique primary keys. If this
column is your primary key, DO
Awesome - thanks all for that clarification!
-Original Message-
From: Michael Dykman [mailto:mdyk...@gmail.com]
Sent: Wednesday, June 30, 2010 1:42 PM
To: David Stoltz
Cc: mysql@lists.mysql.com
Subject: Re: INSERT with auto increment
generally, it is:
INSERT INTO TABLE1 (fieldname
Hi All,
In MS SQL, if the table has an identity field/primary key which is set
to auto increment, you can leave the value out of an INSERT statement,
and the next highest value will be automatically inserted...
For instance, with a two column table I could do INSERT INTO TABLE1
VALUES
-increment will engage on an insert of 0
- michael dykman
On Wed, Jun 30, 2010 at 1:30 PM, David Stoltz dsto...@shh.org wrote:
Hi All,
In MS SQL, if the table has an identity field/primary key which is set
to auto increment, you can leave the value out of an INSERT statement,
and the next highest
, if the table has an identity field/primary key which is set
to auto increment, you can leave the value out of an INSERT statement,
and the next highest value will be automatically inserted...
For instance, with a two column table I could do INSERT INTO TABLE1
VALUES('stuff')
I'm having trouble
From: David Stoltz dsto...@shh.org
In mySQL, if I expressly give it a value, like INSERT INTO TABLE1
VALUES(17,'stuff') - it works fine. But if I remove the 17, it says I
don't have a matching number of columns.
Use NULL for the autoinsert column.
I made it a rule to forbear
It might also be done by keeping a last-revision table. Then you'd only
select 1 record from that, and up the number.
On Thu, Apr 22, 2010 at 5:34 PM, Chris W 4rfv...@cox.net wrote:
Johan De Meersman wrote:
On Thu, Apr 22, 2010 at 1:34 PM, Carsten Pedersen cars...@bitbybit.dk
wrote:
I have a InnoDB table which contains columns named 'cluster' and 'file'
('cluster' + 'file' is a primary key). I want to add a new column that
tracks the revision number of a file for a given cluster and a file. The
situation is tailor made for a MyIsam table where I can add a new Auto
that
tracks the revision number of a file for a given cluster and a file. The
situation is tailor made for a MyIsam table where I can add a new Auto
Increment column as a secondary column in a multiple column index. How can I
get the same behavior in an InnoDB table? Given below is a view of how
for a MyIsam
table where I can add a new Auto Increment column as a secondary
column in a multiple column index. How can I get the same behavior
in an InnoDB table? Given below is a view of how the records will
look like
On Thu, Apr 22, 2010 at 12:09 PM, Aveek Misra ave...@yahoo-inc.com wrote:
I am not sure I understand. If I make the autoincrement column as part of
the primary key as (rev + cluster + file), how do I ensure that a reset of
the revision number is done as soon as (cluster + file) combination
MyISAM has this really cool feature where you can specify autoincrement
on a secondary column in a multiple column index. In such a case the
generated value for the autoincrement column is calculated as
MAX(autoincrement column) + 1 WHERE prefix='given-prefix'. For more
refer to
Kudos for managing to drag up such an obscure piece of functionality :-) I
can see where it would be useful, though.
As to your question, though: given that that page indicates that it will
reuse deleted sequence numbers, I think your best bet would be select @id :=
count(*)+1 from table where
How can count(*) in an InnoDB table be faster than MAX() considering
that the former needs to do a table scan and the latter can use an index
if correctly used? My code starts the sequence from 1.
Thanks
Aveek
Johan De Meersman wrote:
Kudos for managing to drag up such an obscure piece of
The count happens after the where on an index - it should just count the
appropriate index rows without looking at the values. Worth benchmarking on
your dataset, though.
On Thu, Apr 22, 2010 at 1:22 PM, Aveek Misra ave...@yahoo-inc.com wrote:
How can count(*) in an InnoDB table be faster than
On Thu, 22 Apr 2010 13:12:16 +0200, Johan De Meersman vegiv...@tuxera.be
wrote:
Kudos for managing to drag up such an obscure piece of functionality :-)
I
can see where it would be useful, though.
As to your question, though: given that that page indicates that it will
reuse deleted
On Thu, Apr 22, 2010 at 1:34 PM, Carsten Pedersen cars...@bitbybit.dkwrote:
Wouldn't that strategy cause problems if one or more rows have been
deleted in the meantime? (i.e. sequence numbers 1-4 have been created, row
2 has been deleted - new sequence number would be 4).
Yeps. I'm none too
for a MyIsam table where I can add a new Auto
Increment column as a secondary column in a multiple column index. How can
I get the same behavior in an InnoDB table? Given below is a view of how
the records will look like
| Cluster
Johan De Meersman wrote:
On Thu, Apr 22, 2010 at 1:34 PM, Carsten Pedersen cars...@bitbybit.dkwrote:
Wouldn't that strategy cause problems if one or more rows have been
deleted in the meantime? (i.e. sequence numbers 1-4 have been created, row
2 has been deleted - new sequence number would
2009/12/23 Ryan Chan ryanchan...@gmail.com:
Hey.
Back to few years ago, InnoDB require table level locking when
inserting auto-increment PK to the table, and Heikki said there will
be a fix.
Is this problem still exist now?
If you refer to this bug:
http://bugs.mysql.com/bug.php?id=16979
Hey.
Back to few years ago, InnoDB require table level locking when
inserting auto-increment PK to the table, and Heikki said there will
be a fix.
Is this problem still exist now?
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http
Hi;
mysql insert into categories (Category, Parent) values ('test', NULL);
ERROR 1062 (23000): Duplicate entry '0' for key 1
mysql describe categories;
+--+-+--+-+-+---+
| Field| Type| Null | Key | Default | Extra |
Oops. Never mind.
V
On Sat, Dec 5, 2009 at 1:19 PM, Victor Subervi victorsube...@gmail.comwrote:
Hi;
mysql insert into categories (Category, Parent) values ('test', NULL);
ERROR 1062 (23000): Duplicate entry '0' for key 1
mysql describe categories;
Hi,
I have a table 'test'
+-+--+--+-+---
++
| Field | Type | Null | Key | Default |
Extra |
+-+--+--+-+---
++
| id | int(11) | NO
At 9:35 AM +0200 4/2/09, Andreas Pardeike wrote:
Hi,
I have a table 'test'
+-+--+--+-+---++
| Field | Type | Null | Key | Default | Extra |
On Apr 2, 2009, at 12:51 AM, Steve Edberg wrote:
At 9:35 AM +0200 4/2/09, Andreas Pardeike wrote:
Hi,
I have a table 'test'
+-+--+--+-+---
++
| Field | Type | Null | Key | Default |
Extra |
Steve Scott,
Thanks for the suggestions.
The problem with a timestamp is that it's not fine granular. The
consumer application can record last_poll_time and if it is X then
either of the following will not work:
1) select * from table where tstamp = X
- this fails because it will receive
I read your other replies about the timestamp not working. I still
think adding the updated and created fields is a good idea in general,
to any table. I have some questions about the below since the
original suggestion would not work for you.
On Apr 2, 2009, at 12:35 AM, Andreas
Hi,
I have a table 'test'
+-+--+--+-+---
++
| Field | Type | Null | Key | Default |
Extra |
+-+--+--+-+---
++
| id | int(11) | NO
I think ideally I would like to create an auto increment column that
has no requirement for uniqueness. So if 6 was the last entry, and
there are 10 of them, 7 would still be the next, is this possible?
I am assuming it is not?
I am working in a case where data is needing to be de
looking for something like LAST_INSERT_ID()? If you
INSERT a
record that has an auto-increment field, you can retrieve the value
that got
inserted with SELECT LAST_INSERT_ID(). It is connection-specific, so
you'll always have your own value. You can then save it to reuse,
either
as a session
that has an auto-increment field, you can retrieve the value
that got
inserted with SELECT LAST_INSERT_ID(). It is connection-specific, so
you'll always have your own value. You can then save it to reuse, either
as a session variable or (more easily) as a hidden field on your form.
Thanks, Jerry
-Original Message-
From: PJ [mailto:af.gour...@videotron.ca]
Sent: Thursday, February 26, 2009 11:27 AM
To: Jerry Schwartz
Cc: a...@ashleysheridan.co.uk; 'Gary W. Smith'; 'MySql'; php-
gene...@lists.php.net
Subject: Re: [PHP] RE: non-auto increment question
Jerry Schwartz wrote:
Being
Here's how I mostly do it (albeit simplified):
$query = INSERT INTO `sometable`(`title`,`content`)
VALUES('$title','$content');
$result = mysql_query($query);
$autoId = mysql_insert_id($result);
$query = INSERT INTO `another_table`(`link_id`,`value`)
VALUES($autoId,'$value');
$result =
Ashley Sheridan wrote:
On Thu, 2009-02-26 at 13:44 -0500, Jerry Schwartz wrote:
Here's how I mostly do it (albeit simplified):
$query = INSERT INTO `sometable`(`title`,`content`)
VALUES('$title','$content');
$result = mysql_query($query);
$autoId = mysql_insert_id($result);
$query =
Sorry, I should know better.
-Original Message-
From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
Sent: Thursday, February 26, 2009 1:51 PM
To: Jerry Schwartz
Cc: 'PJ'; 'Gary W. Smith'; 'MySql'; php-gene...@lists.php.net
Subject: RE: [PHP] RE: non-auto increment question
On Thu
Being rather new to all this, I understood from the MySql manual that
the auto_increment is to b e used immediately after an insertion not
intermittently. My application is for administrators (the site owner
designates) to update the database from and administration directory,
accessed by
I want to insert a new table entry 1 number higher than the highest in
the field (id). I cannot use auto-increment.
And I want to show the value of the field to be added in an input field
on the web page:
if (isset($_REQUEST[AddNewBooksRequest])) {
$SQL = SELECT MAX(id) FROM book
.
From: PJ [mailto:af.gour...@videotron.ca]
Sent: Wed 2/25/2009 2:01 PM
To: MySql; php-gene...@lists.php.net
Subject: non-auto increment question
I want to insert a new table entry 1 number higher than the highest in
the field (id). I cannot use auto-increment.
And I want to show the value
the same generated id.
Hope that helps.
From: PJ [mailto:af.gour...@videotron.ca]
Sent: Wed 2/25/2009 2:01 PM
To: MySql; php-gene...@lists.php.net
Subject: non-auto increment question
I want to insert a new table entry 1 number higher than the highest
Being rather new to all this, I understood from the MySql manual that
the auto_increment is to b e used immediately after an insertion not
intermittently. My application is for administrators (the site owner
designates) to update the database from and administration directory,
accessed by
/password login... so there's really very little
possibility of 2 people accessing at the same time.
By using MAX + 1 I keep the id number in the $idIn and can reuse it in
other INSERTS
[JS] Are you looking for something like LAST_INSERT_ID()? If you INSERT a
record that has an auto-increment field
Hello friends,
I need to reset auto increment to a lesser value, is there a metod to do so
in any version of mysql.
Pl. help me.
Thanks
abhi
auto increment to a lesser value, is there a metod to do
so
in any version of mysql.
Pl. help me.
Thanks
abhi
Hi Nacho,
Thanks for the reply,
But as per a thread on this link, if the resetted value is less than the
highest value already in table then the effective increment value will start
to start from those
row-ids.
That can't be done. An auto-increment value must be higher than the
highest existing value. Otherwise, it would not be an auto-increment
value at all - it would be an auto-interpolate.
On a more general note, if the actual value of the primary key matters
for anything
Mark Goodge wrote:
On a more general note, if the actual value of the primary key matters
for anything other than simply existing as a primary key, then you
shouldn't be using auto-increment at all. You should generate the
value through some other means and insert it with the value that you
Chris W wrote:
Mark Goodge wrote:
On a more general note, if the actual value of the primary key matters
for anything other than simply existing as a primary key, then you
shouldn't be using auto-increment at all. You should generate the
value through some other means and insert
If you are getting duplicate id's on the slave, then something is not
setup correctly. The save should have the same ids as the master. Just
because a field is auto-increment, doesn't mean you can't enter you
own value. Think of auto-increment as a default value setting.
Just because
advise.
On Sun, Apr 20, 2008 at 11:01 AM, Brent Baisley [EMAIL PROTECTED] wrote:
If you are getting duplicate id's on the slave, then something is not
setup correctly. The save should have the same ids as the master. Just
because a field is auto-increment, doesn't mean you can't enter you own
duplicates, its just that its id on slave was already occupied by some
previous entry!!
I see mysql 5 has options like: auto-increment-increment
auto-increment-offset , but with v4.1
Any help is appreciated.
Thanks!
Is there away to reset an auto incrementing field count? I have a
database that currently has 935 records in it but because I have
deleted a few the current number used for NEW records is 938 :) How
can I get it to count the records and assign a record number based on
the total count?
?
Hope that makes sense! Thanks for looking! :)
--
Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]
AFAIK, you need to drop and then recreate the auto-increment field,
otherwise you'll get holes when you delete
is not changed.
Ed
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 29, 2007 11:02 AM
To: Jason Pruim
Cc: MySQL List
Subject: Re: Reset a auto increment field?
Is there away to reset an auto incrementing field count? I have a
database
If I understand you correctly, if my table is MyISAM, after I did a
delete query I could just: ALTER TABLE t2 AUTO_INCREMENT=1; and
that would cause the auto increment value to be set to 901 (Assuming
900 total current records) on the next insert?
On Aug 29, 2007, at 1:48 PM, [EMAIL
Yes, for a MyIsam type table.
Ed
-Original Message-
From: Jason Pruim [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 29, 2007 11:53 AM
To: emierzwa
Cc: [EMAIL PROTECTED]; mysql@lists.mysql.com
Subject: Re: Reset a auto increment field?
If I understand you correctly, if my table
Hi Jason,
Jason Pruim wrote:
Is there away to reset an auto incrementing field count? I have a
database that currently has 935 records in it but because I have deleted
a few the current number used for NEW records is 938 :) How can I get it
to count the records and assign a record number
www.the-infoshop.com
www.giiexpress.com
www.etudes-marche.com
-Original Message-
From: Jason Pruim [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 29, 2007 1:53 PM
To: [EMAIL PROTECTED]@micron.com
Cc: [EMAIL PROTECTED]; mysql@lists.mysql.com
Subject: Re: Reset a auto increment field
On Aug 29, 2007, at 2:30 PM, Shawn Green wrote:
Hi Jason,
Jason Pruim wrote:
Is there away to reset an auto incrementing field count? I have a
database that currently has 935 records in it but because I have
deleted a few the current number used for NEW records is 938 :)
How can I get
Jason Pruim wrote:
snip
I see what you are getting at with this, and have decided that mucking
around with auto incrementing values doesn't exactly fit in with the way
databases were designed to work.
Somehow though, I still need to supply this whether I end up adding a
Record number
Do you mean you want to be able to display the record number as sorted by
the auto-increment field, rather than the auto-increment field itself? Or do
you just want the total number of records? Or do you just want the highest
current value of the auto-increment field?
The latter two are easy
. The downside is that all your queries (joins too) will
need to reference 2 fields instead of 1.
On Aug 7, 2007, at 8:05 AM, shivendra wrote:
Hi, I'm looking for some basic help. I am developing a MySQL
database and
want to auto increment a field, but I don't want it to just count
1,2,3,
etc
Hi, I'm looking for some basic help. I am developing a MySQL database and
want to auto increment a field, but I don't want it to just count 1,2,3,
etc. I want the field to be a combination of letters and numbers, at least 8
digits long, completely random for security porposes, but do
developing a MySQL database and
want to auto increment a field, but I don't want it to just count 1,2,3,
etc. I want the field to be a combination of letters and numbers, at least
8
digits long, completely random for security porposes, but do this
automatically, everytime a record is added
Int'l Airport, NJ 08405
Phone 609.485.5401
Olexandr Melnyk [EMAIL PROTECTED]
08/07/2007 08:19 AM
To
mysql@lists.mysql.com
cc
Subject
Fwd: auto increment format
You can do that using a before insert trigger, something like (untested)
:
CREATE TRIGGER test1bi
BEFORE INSERT ON test1
Developer
Ricomm Systems Inc.
FAA, WJHTC/Bldg 300, 3nd Fl., L33
Atlantic City Int'l Airport, NJ 08405
Phone 609.485.5401
Olexandr Melnyk [EMAIL PROTECTED]
08/07/2007 08:19 AM
To
mysql@lists.mysql.com
cc
Subject
Fwd: auto increment format
You can do that using a before insert
Shivendra:
It looks to me based on your example that you are creating a smart field
where the first three chars are some sort of category and the numeric part is
random. If you example is accurate then a char(3) field and a standard
auto_increment field will do the trick. If uniqueness is
On 8/7/07, Boyd Hemphill [EMAIL PROTECTED] wrote:
Suggestions to use a hash are a problem because once you have a few
million rows the likelihood of a collision is quite high if you cannot
afford an error stopping your application. This means that if you write a
trigger (the obvious way to
Hello Everybody,
i want to read the latest value of a autoincrement column from a java
program. How can i do this? i want to do this in a single query insertion,
is it possible?
Hello,
you can do it in two ways I guess:
one is to do a second select (which you don't want):
SELECT LAST_INSERT_ID().
another way is to use java.sql.Statement.RETURN_GENERATED_KEYS
when you create your Statement, something along these lines:
java.sql.PreparedStatement pstmt =
Hi all,
I had somewhat of a performance question. I have an association table with 2
unique values which will always be selected by one of the values (never by
id). That said, I'm wondering which would be a better gain, having this:
CREATE TABLE association_sample (
`id` INTEGER NOT NULL
Chris, I'd opt for the first, but with an index on each of
association_id1 and association_id2.
I like always having an identity column to be able to remove or update
an individual entry easily. But for speed, you'll want indexes on the
other columns.
I would either do no multi-column indexes,
Message-
From: Chris White [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 03, 2006 2:20 PM
To: mysql@lists.mysql.com
Subject: Combined Primary Key and Auto Increment Primary Key
Hi all,
I had somewhat of a performance question. I have an
association table with 2
unique values which
All,
We are using circular replication now on db's that were originally stand
alone. One problem we have is that all the primary index fields for
most of the tables are auto increment fields. This prevents us from
writing to both db servers because of confilicting INDEX entries. Is
there some
down for variables auto_increment_*)
Kishore Jalleda
On 3/13/06, Jeff [EMAIL PROTECTED] wrote:
All,
We are using circular replication now on db's that were originally stand
alone. One problem we have is that all the primary index fields for
most of the tables are auto increment fields
Hi, im hoping to solve a problem that is bugging me!
I just moved a database from a development server to production (test),
several of the fields have auto-increment ticked but as it is mainly a
data warehouse i thought nothing of it. I then found that a lot of my
queries were running slow
1 - 100 of 428 matches
Mail list logo