MySQL Forums
Forum List  »  Newbie

Re: update queries taking 1 week to finish
Posted by: Peter Brawley
Date: August 25, 2014 03:09PM

drop table if exists descriptors;
Descriptors is just a lookup table storing the meaning of `idx` values eg for reports. It'll have 7 rows...

create table descriptors(idx tinyint, description char(32));
insert into descriptors values
(1, 'employee with ID' ),
(2, 'age' ),
(3, 'rank' ),
(4, 'salary range' ),
(5, 'projects managed' ),
(6, 'projects finished this year' ),
(7, 'project overdue days');

Your result tables will have 6 or 7 times as many rows as they do now, millions of rows, which is not a lot, and they will query hundreds of times faster without those nonsensical loops.

You're going to need to read about database design, eg http://www.artfulsoftware.com/dbdesignbasics.html

Options: ReplyQuote


Subject
Written By
Posted
Re: update queries taking 1 week to finish
August 25, 2014 03:09PM


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.