 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| l |
prepare() - what happens in the server
|
|
|
|
– |
Receive and
parse the SQL statement into internal form
|
|
|
|
– |
Get details for
all the selected tables
|
|
|
|
– |
Check access
rights for each
|
|
|
|
– |
Get details for
all the selected fields
|
|
|
|
– |
Check data types
in expressions
|
|
|
|
– |
Get details for
all the indices of the tables
|
|
|
|
– |
Develop an
optimised query 'access plan' for best execution
|
|
|
|
– |
Return a handle
for all this cached information
|
|
|
|
n |
This can be an
expensive process - especially the 'access plan'
|
|
|
n |
Some databases,
like MySQL, don't cache the information but
|
|
|
|
have simpler,
and thus faster, plan creation
|
|