Subject | Re: [firebird-support] Need Speed Optimization for SQL |
---|---|
Author | Robert martin |
Post date | 2015-04-15T22:32:16Z |
Wow !
Do you have an index on CRM_JOB_ITEMS.PK_JOB_ITEMS ?
On 16/04/2015 10:29 a.m., Vishal Tiwari vishualsoft@...
[firebird-support] wrote:
Do you have an index on CRM_JOB_ITEMS.PK_JOB_ITEMS ?
On 16/04/2015 10:29 a.m., Vishal Tiwari vishualsoft@...
[firebird-support] wrote:
> @Rob: Your SQL is taking 28 seconds...
>
>
>
> On Thursday, 16 April 2015 3:56 AM, "Robert martin rob@...
> [firebird-support]" <firebird-support@yahoogroups.com> wrote:
>
>
> Hi
>
> Try replacing your IN statement with an EXISTS clause. Something like
>
> CRM_DOCUMENT_HEADER.DOCUMENT_TYPE = 1 AND EXISTS(select PK_JOB_ITEMS
> from CRM_JOB_ITEMS where PK_JOB_ITEMS = CRM_DOCUMENT_ITEMS.FK_JOB_ITEM
> and FK_JOB = '{8BDDED49-8509-48C1-A169-B7E68A74C230}' ROWS 1)
>
> Cheers
> Rob
>