• 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:

Driving table in sql

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I need some clarification. Could someone explain what the Driving table is, and what its significance is? I'm trying to optimize my query....what are the things that I should keep in mind when optimizing ?
As far as I know,a Driving table is the table that is accessed first in a select statement. In the following statement:
SELECT * FROM EMPLOYEE E,ADDRESS A WHERE A.ADDNO = E.ADDNO
Is EMPLOYEE the Driving table, or ADDRESS, ie, the first table in WHERE clause or first table in FROM clause ? I'm confused!!!
Can someone point me to a good link where I can find answers to questions related to optimizing sql statements, and which conditions use indexes and which don't (using wildcards with LIKE clause disables indexes ???) and related doubts.
Thanks a lot. I appreciate all the responses.
 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The driving table is the "point" table for your database request. If you have a query for an employee record, it would be the employee table, and the address table is driven off of the employee table. So it is the pivotal table in the request. An picking the right one does effect performance.
There are so many things to look at for tuning performance that the write entire books on the subject. And it also depends on the database you have because they each optimize differently. Yes, if you use like '%abc% an entire table scan will be done. If you use functions like substr on a column before comparing it, the indexes can't be used. But you really need to get some books on the subject for the database being used.
Dan
 
reply
    Bookmark Topic Watch Topic
  • New Topic