Hector, I migrated from Visual FoxPro too. VFP has different style to work with a table. MySQL gives you some advantage which you don't have it in VFP. for example, try to connect to the work server from home and run this query. it will take 5 days to finish it, but still MySQL takes 3 min.s :) believe me because I did this test and our company decided to stop using VFP and rewrite everything in VB and MySQL.
BUT my experience: try to change the logic of your report not to retrieve large number of records. user LIMIT to create the reports page by page. this is the best and even better for the user. good luck ----- Original Message ----- From: "Matt W" <[EMAIL PROTECTED]> To: "Héctor Villafuerte D." <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, October 24, 2003 3:00 PM Subject: Re: Really slow query (compared with Visual FoxPro) > Hi Hector, > > Umm, it looks like you're simply doing a SELECT in the first query and > *populating a new table* in the second. Of course inserting 3.3 million > rows is going to take extra time! How can you even compare the 2 when > they're doing different things? > > > Matt > > > ----- Original Message ----- > From: "Héctor Villafuerte D." > Sent: Friday, October 24, 2003 12:10 PM > Subject: Really slow query (compared with Visual FoxPro) > > > > Hi all, > > I'm migrating from Visual FoxPro (I'm a newbie). > > On a daily basis I need to run this query on a table with a little > more > > than > > 5 million records. > > > > + MS Visual FoxPro 6.0 > > select tel, telefb, rutaentran, rutasalien, sum(minutos) as minutos > from > > traf_oper > > group by 1, 2, 3, 4 into table oper_grp > > This took about 173 seconds (let's say 3 minutes) > > > > + MySQL 4.1.0-alpha-max-nt > > mysql> create table oper_grp select tel, telefb, rutaentran, > rutasalien, > > -> sum(minutos) as minutos from traf_oper group by 1, 2, 3, 4; > > Query OK, 3301017 rows affected (8 hours 36 min 48.83 sec) --->>> 516 > > minutes! > > Records: 3301017 Duplicates: 0 Warnings: 0 > > > > Why is there such a big difference?! Any optimization tips I could > follow? > > Thanks in advance, > > Hector > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]