Re: stored procedure problem
Posted in 1998
Juan R. Guzman wrote:
> I have a stored procedure on two machines (same hardware, one with Solaris
> 2.5.1 and the other Solaris 2.6), server 1 w/ online 7.22 UC1 and the server
> 2 with online 7.23uc6. In this stored procedure there is a select statement
> which is puzzling me. Here is why:
>
> on server 1:
>
> the select statement uses an index within the SPL but if I take the same
> select statement and run it thru dbaccess it does a sequential scan.
>
> on server 2;
> the select statement uses sequential scan in and outside the spl.
>
> The query takes 8 seconds when using the index and 1 minute when it doesn't.
> My question is why is the engine not being consistent all around. I've done
> update statistics on the tables and procedure involved and the behavior does
> not change.>
> Any help would be greatly appreciated since it is holding up my upgrade.
The Query plan of a SP is determined Either at the time the SP was created or
at when an update stat is run on it. The Query plan decides what kind of access
a Query will take. This could as well be the reason why your are getting
different results.
Hope I was of help.
Ramesh