db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Rivera <frank.riv...@HoudiniESQ.com>
Subject Fwd: When to shut down a database
Date Fri, 11 Apr 2014 16:15:37 GMT
We have a simple query using LIKE but is very slow. We need to tell the optimizer which index
to use but the override DERBY-PROPERTIES statement returns an error. here is the SQL.

SELECT 
esq.attachment.guid 
FROM 
esq.attachment 
--DERBY-PROPERTIES index = ATTACHMENT_LINKNAMES_INDEX
where 
(   
 	esq.attachment.file_name  LIKE ‘%drisco%' 
   OR esq.attachment.file_index_name  LIKE ‘%drisco%' 
)
AND
(
        esq.attachment.link_guid IS NOT NULL 
        AND 
        esq.attachment.link_table='mat'  
        AND 
        esq.attachment.link_guid IN (
                SELECT esq.matter.guid 
                FROM esq.matter 
                WHERE 
                esq.matter.guid=esq.attachment.link_guid 
                AND ( 
				( esq.matter.grp_guid=0 OR esq.matter.grp_guid IS NULL ) OR ( esq.matter.grp_guid>0
AND esq.matter.grp_guid IN ( 2,1,6,4,3 ) ) 
			)   
                        
        )
) ;
   




Sincerely,

 	Frank Rivera
	LogicBit Software - Research Triangle Park, North Carolina
		
	


Mime
View raw message