MySQL Forums
Forum List  »  Performance

Re: speed up query
Posted by: Rick James
Date: April 29, 2010 09:18AM

Oops -- you may have some troubles...

id AUTO_INCREMENT...PRIMARY KEY(id, time)
does NOT make AUTO_INCREMENT work correctly -- you can get duplicate ids because there is no UNIQUE constraint on id alone.

It may be better to have no PRIMARY or UNIQUE key. For that matter, drop `id`.

There is some pseudo-bug about NULLs going into the first partition; it _may_ be advantageous to have an empty first partition (VALUES LESS THAN (0)) so that the table scan of that partition will be fast.

Options: ReplyQuote


Subject
Views
Written By
Posted
4145
April 18, 2010 06:42AM
1512
April 18, 2010 04:04PM
1592
April 18, 2010 05:40PM
1317
April 27, 2010 02:29PM
1464
April 27, 2010 07:59PM
1321
April 28, 2010 12:12AM
1581
April 28, 2010 06:22AM
1524
April 29, 2010 01:03AM
1379
April 29, 2010 02:17AM
1384
April 29, 2010 08:19AM
Re: speed up query
1386
April 29, 2010 09:18AM
1315
April 30, 2010 12:30AM
1570
April 30, 2010 07:47AM
1487
April 30, 2010 08:21AM
1399
April 30, 2010 10:08AM
1321
May 01, 2010 02:34AM
1337
May 01, 2010 09:54AM
1289
May 01, 2010 10:48AM
1418
May 01, 2010 02:20PM
1357
May 02, 2010 03:54AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.