If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > Query Optimizer Problem?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-02-03, 08:06
AJV AJV is offline
Registered User
 
Join Date: Feb 2003
Posts: 9
Query Optimizer Problem?

I just want to make an outer join query using an 'order by' clause. The problem is that I thing that the query optimizer does not take into consideration the index that I have in the table.

The query below take about 13 mins to be executed in the PCC
Select ADID,
ADERPCode,
ADSTypeLineNo,
ad1.UD***alueStr as ADSType,
ADAlphaName,
ADAdrsLine1,
ADCity,
ADCountryLineNo
from Address
left join UDCValue ad1 on (ad1.UDCVID = 1 and ad1.UDCVLineNo = ADSTypeLineNo )
order by ADID

Note that in the table address exists a unique index on column ADID. (For information purposes I must say that the table 'Address' has 15000 rows and table 'UDCValue' has 1000 rows).

I try to run the same query without the 'order by' clause and it took about 1.5 seconds!!!

What is the problem? Can you help us? Is there any work around to overcome the problem?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On