sql - Oracle Query or statement issue, and performance tuning -


I'm having problems executing my query properly. I have 70 million rows I have a specific table The client wants to find an IP table for specific IP specifications. These dates are controlled from the date of a deallocation.

As such,

I am trying to find a table for a specified IPS when the date of the distribution is zero or the 1st and the 1st month of my query It does not run very fast, for the first time when I run it or tap the deallocation_date on the same line, it returns every line.

Here is my query the way I participated it, and it brought back every customer back not only the client I was looking for, it took 1 minute to execute it.

  Specific E. Api_adres, Kstmastr_nam, Sikwhim_aidi, D Select .allocation_date, customers one of d.deallocation_date b, c VMS vm_groups, vm_ip_address_histories D, E ip_addresses where a.customer_id = 30 and a.customer_id = b.customer_id and b.vm_group_id = C.vm_group_id and c.vm_id = D. Vm_id and d.ip_address_id = e.ip_address_id and d.deallocation_date between empty or triangle (d.deallocation_Date) to_date ('1-oct-14') and to_date ('31 --14-14 ') /  <

  Specific E.P.Adress, Custom_name, c. VM_ID, D. Select Allocation_data. The D.deallocation_date customers A, V m_groups b, c VMS, vm_ip_address_histories D, E ip_addresses where a.customer_id = 30 and a.customer_id = b.customer_id and b.vm_group_id = c.vm_group_id and c.vm_id = d.vm_id and D.ip_address_id = e.ip_address_id and D.deallocation_date is_date ('1-oct-14') and to_date ('31-oct-14 ') /  

between zero or triangle ( D.deallocation_Date) This way it did not solve it I thought it did, but it did not return the values ​​with deallocation dates.

  different e.ip_address, a custom client name, Ckvm_id, Dkallocation_date, select d.deallocation_date customers, vm_groups b, c VMS, vm_ip_address_histories D, E ip_addresses where a.customer_id = 30 and a.customer_id = b.customer_id and b.vm_group_id = c.vm_group_id and c.vm_id = d.vm_id and d.ip_address_id = e .ip_address_id and (d.deallocation_date) or empty triangle (d.deallocation_Date ) To_date ('1-oct-14') and to_date ('31-oct-14 ')) /  

I also tried and returned only with empty values Returned.

  different e.ip_address, a.customer_name, c.vm_id, d.allocation_date, d.deallocation_date clients a, b Vm_groups, VMS c, d vm_ip_address_histories, select ip_addresses E where a. Customer_id = 30 and a.customer_id = b.customer_id and b.vm_group_id = c.vm_group_id and c.vm_id = d.vm_id and d.ip_address_id = e.ip_address_id and exist (select * from vm_ip_address_histories where d.deallocation_date is null Or TRUNC (between '1-Oct-14') and last_day ('1-Oct-14') and  

  different AP address, custom_name, cvmid, d.loconcation_det, d. Delocution_adet, g The Ahkon, vm_groups b, vms c, vm_ip_address_histories d, ip_addresses E where a.customer_id = 30 and a.customer_id = b.customer_id and b.vm_group_id = c.vm_group_id and c.vm_id = d.vm_id and d.ip_address_id = e .ip_address_id and (d.deallocation_date is empty or d.deall date-date ('01-10-2014 ',' DD-MM-YYYY ') and to-date ('31 -10-2014 23:59:59' , 'D.C.-MM-YYYYHH 24: MI: SS') between the authorization_adet /  

Comments