• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

SQL tuning & optimization queries

 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I understand that by indexing a table, it would improve on the performance of a query. So if thats the case, won't it be good that I create indexes for all columns of all my tables? Is there any pitfalls in doing so?

Read from some optimization guides that ORDER BY does affect the performance negatively, but why?

Hopefully someone could enlighten me on these issues.

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Maintaining index is quite difficult thing. U need extra storage for that.
Again when there is DML operation on that table subsequently index need to be updated.

When user want to retrive data more than 5% it is not recommended to use index.

Second thing u r talking is about the order by. When order by is specified in the query sorting is done in memory which consumes lot of resoureses and makes the exection slow.

HTH..

--Mahesh
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic