Home » SQL & PL/SQL » SQL & PL/SQL » How can I speed this query up?
How can I speed this query up? [message #687655] Thu, 27 April 2023 13:49 Go to next message
DevMuch
Messages: 2
Registered: April 2023
Junior Member
Hello Everyone,

First post here and I'm very new to Oracle.  I have isolated a query and I am running it in TOAD and viewing the Explain Plan.  I THINK this query can be sped up but I don't know how to get it there.


Here is my query...

select pev.idMaterial 
   
    from st_service v,
         cta_ServiceDefinition vd,
         st_PtyMaterialService pev
    where vd.crServiceDefinition = :c_crServiceDefinition_SectionNo
    and vd.idServiceDefinition = v.idServiceDefinition 
    and v.idService = pev.idPTYMaterialService  
    
    and v.szService = :v_szSectionNo

    and pev.idMaterial <> :p_idMaterial         
    and pev.dtBegin = (
    select max(pev2.dtBegin)
        from st_service v2,
             st_PtyMaterialService pev2 
        where pev2.idMaterial = pev.idMaterial
        and pev2.idPtyMaterialService = v2.idService
        and v2.idServiceDefinition = v.idServiceDefinition
        and pev2.dtBegin <= :p_dtNow
        and (pev2.dtEnd > :p_dtNow or pev2.dtEnd is null)    
        );
If anyone has any thoughts, I'd greatly appreciate it.


Re: How can I speed this query up? [message #687656 is a reply to message #687655] Thu, 27 April 2023 15:01 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

For any SQL performances question, please read http://www.orafaq.com/forum/index.php/mv/msg/206002/433888/#msg_433888 and post the required information.

Re: How can I speed this query up? [message #687657 is a reply to message #687656] Thu, 27 April 2023 15:11 Go to previous message
DevMuch
Messages: 2
Registered: April 2023
Junior Member
Thanks Michel for the helpful links.  
Previous Topic: LOB Locator
Next Topic: Group By (merged)
Goto Forum:
  


Current Time: Thu Mar 28 04:38:23 CDT 2024