🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #10992

Re: how can I speed up this query

#10992
From: Marcos Pegoraro
Date: Sat, 21 Dec 2002 11:13
23 lines
2112 bytes
Yes, I have Indexes for PayDate and DueDate.

The plan for my select is
Statement: Select P.Name, R.* from Receive R inner join Customer P on
R.Customer_ID = P.Customer_ID where R.Receive_ID = (select min(Receive_ID)
from Receive where (PayDate is Null or PayDate between '12/01/02' and
'12/31/02') and
Contract_ID=R.Contract_ID group by Contract_ID ) and R.DueDate between
'12/01/02' and '12/31/02'

PLAN (FIN_RECEBER ORDER RDB$FOREIGN141)
PLAN (SYS_LOOKUP INDEX (RDB$PRIMARY4))
PLAN (SYS_LOOKUP INDEX (RDB$PRIMARY4))
PLAN (SYS_LOOKUP INDEX (RDB$PRIMARY4))
PLAN (SYS_LOOKUP INDEX (RDB$PRIMARY4))
PLAN (CAD_PESSOA INDEX (RDB$PRIMARY1))
PLAN JOIN (R INDEX (IDXRECEBERVENCIMENTO),P INDEX (RDB$PRIMARY1))

All these Plans for SYS_LOOKUP exist because on Receive I have some fields
which are Computed By
and this Computed By selects a Description from a Lookup table. But this is
not my problem because when I select * from Receive, it returns in 0.006 Sec
and does all these Lookups too.
Technical Details
Message-ID: <3e044ce1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mail
References: <3e03bb4d@newsgroups.borland.com> <3e044201@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 114a0e,bdd368e2d37d69d2
X-Google-Attributes: gid114a0e,public
X-Google-ArrivalTime: 2002-12-21 03:15:04 PST
From: "Marcos Pegoraro" <mpegoraro@brturbo.com>
Newsgroups: borland.public.interbase.sql
References: <3e03bb4d@newsgroups.borland.com> <3e044201@newsgroups.borland.com>
Subject: Re: how can I speed up this query
Date: Sat, 21 Dec 2002 09:13:39 -0200
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 200.181.182.51
Message-ID: <3e044ce1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1040469217 200.181.182.51 (21 Dec 2002 03:13:37 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mail