Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using Indexing concept for performance ?

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers ,

Is Indexing on a Database column is performed dynamically depending on the search parameters selected by the user? Or at the time of table creation ??
 
steve souza
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't speak for all databases, but in Sybase the query optimizer looks at the arguments passed to a query and determines the best available index or none at all based on which one it thinks will perform best at the time of the query.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you describe , How can i write a SQL Query which performs dynamic indexing of a database column??
 
Anurag Blore
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ravi,

I am not sure if youcan write a SQL which will create indexing on a table. You shuold create index on a table based on your requirement. Creating indexing on all the columns could have performance impact.

You can refer here for basic indexing conepts
sql indexing

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anurag Blore wrote:Ravi,

I am not sure if youcan write a SQL which will create indexing on a table. You shuold create index on a table based on your requirement. Creating indexing on all the columns could have performance impact.

You can refer here for basic indexing conepts
sql indexing




Thanks a lot.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18272
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Indexing isn't actually defined by the SQL standard, which is based on abstract data access without regard to the limitations of the real world. Some DBMS's may index on their own initiative, but most commonly it's explicitly done via DDL.

Indexing can greatly speed performance, but it can also do the reverse. A classic example is to do a bulk load for an indexed table. Because the index trees are usually being rebalanced with each record loaded, this can make a load take an excruciatingly long long time. Instead, the common procedure is to load an unindexed table, then index it. That's actually a practice that predates DBMS's as we know them.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:
Indexing can greatly speed performance, but it can also do the reverse. A classic example is to do a bulk load for an indexed table. Because the index trees are usually being rebalanced with each record loaded, this can make a load take an excruciatingly long long time.


Great point . Thank you very much
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic