Subject | Re: [firebird-support] Re: Optimizing a query |
---|---|
Author | Martijn Tonies |
Post date | 2006-11-28T09:35:46Z |
Hi,
Stored Procedure, that should be faster. Let me know the results.
Martijn Tonies
Database Workbench - development tool for Firebird and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
>Instead of doing the FIRST 20 here, I suggest you do that in your
> > SELECT FIRST 20 SKIP 0 * from ASSET_LIST_GET_PRC();
Stored Procedure, that should be faster. Let me know the results.
> > The query is taking 34 minutes to run, which clearly isn't going toNo WHERE?
> work.
>
> Tell your users they are being impatient :)
>
> > Here is the query:
> >
> > SELECT
> > ASSET.ASSET_ID,
> > ASSET.ASSET_SERIAL_NO,
> > CLIENT.CLIENT_NAME,
> > ASSET.PURCHASE_DATE,
> > ASSET_TYPE1.AT_NAME,
> > MODEL.MODEL_NO,
> > ASSET.DESCRIPTION
> > FROM
> > ASSET
> > INNER JOIN ASSET_TYPE ASSET_TYPE1 ON (ASSET.AT_ID =
> > ASSET_TYPE1.AT_ID)
> > INNER JOIN CLIENT ON (ASSET.FK_CLIENT_ID = CLIENT.CLIENT_ID)
> > INNER JOIN CLIENT_SITE ON (ASSET.FK_SITE_ID =
> CLIENT_SITE.SITE_ID)
> > INNER JOIN MODEL ON (ASSET.MODEL_ID = MODEL.MODEL_ID),
> > ASSET_TYPE
> > order by ASSET.ASSET_SERIAL_NO ASCENDING
Martijn Tonies
Database Workbench - development tool for Firebird and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com