![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
It is a known problem ^^^^^^^^^^^^^^^^^^^^^^^ |
|
that LARGE tables when joined with another table, even though indexed, will cause a scan of the table especially fields that are in CHAR format. My example is SSN: SELECT date(Max("dealsummary"."dealenddt")) INTO :ldt_prevdealenddt FROM "customersummary", "dealsummary" WHERE ( "dealsummary"."branchnbr" = "customersummary"."branchnbr" ) and ( "dealsummary"."customernbr" = "customersummary"."customernbr" ) and ( "customersummary"."ssn" = :ls_ssn ; As odd as it may sound, by adding a GROUP BY and using the field in the same index, in this example SSN, it forces the use of the index and in my case stopped the scanning. GROUP BY "customersummary"."ssn" |
![]() |
| Thread Tools | |
| Display Modes | |
| |