| 1 | = What to do when you run out of database IDs = |
| 2 | |
| 3 | If your project processes 2^32^ |
| 4 | jobs you'll run out of IDs in the result table. |
| 5 | If this happens you can compress the ID space using the following queries: |
| 6 | {{{ |
| 7 | alter table result add column tmpid int; |
| 8 | |
| 9 | set @count = 0; |
| 10 | update result set tmpid = @count:= @count + 1; |
| 11 | |
| 12 | update workunit inner join result on result.id = workunit.canonical_resultid set workunit.canonical_resultid = result.tmpid; |
| 13 | |
| 14 | update result set id = tmpid; |
| 15 | |
| 16 | alter table result auto_increment = 1; |
| 17 | }}} |