> I never said that my SQL would be faster than your non-
> standard messy code.
:rollin
3 lines of Transact SQL is messy and non-standard? its not like I am suggesting to do 30-50 lines - there is no reason why not to do it. anyhow, maybe if you did enough optimisations you'd learn that optimised code is non-standard by definition - its _optimised_
> I recently reduced the running time of a 4 hour query to 20
> minutes.
great, and I've recently improved query from 3 sec to 0.1 sec - tables with 5 mln rows involved. care to offer your solution to effective substring searches? ie optimise the following:
create table Products (SKU int, Keywords varchar(255)
select * from Products where Keywords like '%keyword1%' and Keywords like '%keyword2%'
table scans are pretty expensive for table with 100k's products
going to present this to local Perl Mongers group btw.
> I could have spent weeks improving it to 5 minutes, but it
> wouldn't give any further benefit to an 8 hour process.
agree in principle - but in this case fast optimisation was not big work at all -- the mani difference is in understanding what exactly database is doing in order to execute "not in" query, its that knowledge that allows to optimise code not just slapping index in hope it would improve performance -- it will but only finitely.
> standard messy code.
:rollin
3 lines of Transact SQL is messy and non-standard? its not like I am suggesting to do 30-50 lines - there is no reason why not to do it. anyhow, maybe if you did enough optimisations you'd learn that optimised code is non-standard by definition - its _optimised_
> I recently reduced the running time of a 4 hour query to 20
> minutes.
great, and I've recently improved query from 3 sec to 0.1 sec - tables with 5 mln rows involved. care to offer your solution to effective substring searches? ie optimise the following:
create table Products (SKU int, Keywords varchar(255)
select * from Products where Keywords like '%keyword1%' and Keywords like '%keyword2%'
table scans are pretty expensive for table with 100k's products
going to present this to local Perl Mongers group btw.
> I could have spent weeks improving it to 5 minutes, but it
> wouldn't give any further benefit to an 8 hour process.
agree in principle - but in this case fast optimisation was not big work at all -- the mani difference is in understanding what exactly database is doing in order to execute "not in" query, its that knowledge that allows to optimise code not just slapping index in hope it would improve performance -- it will but only finitely.
Comment