Can u any imrove this query for maximum performance
select g_com_bu_entity bunt_entity
, g_com_rep_cd srep_cd
, effdt from_dt
, eff_status
, g_com_role role
, g_com_pgm prgm
, g_com_district district
, g_com_draw_status draw_status
, decode(g_com_primary_pgm, 'Y',1, 0) pri_prgm_flag
FROM ps_g_com_assign_vw@commissions c1
WHERE effdt =
(SELECT MAX (effdt)
FROM ps_g_com_assign_vw@commissions c2
WHERE c1.g_com_bu_entity = c2.g_com_bu_entity
AND c1.g_com_rep_cd = c2.g_com_rep_cd);
can anyone make it as regular query for maximum performance
Thanks,
Sreekanth
Hi Sreekant,
Try this: If it helps
select g_com_bu_entity bunt_entity
, g_com_rep_cd srep_cd
, effdt from_dt
, eff_status
, g_com_role role
, g_com_pgm prgm
, g_com_district district
, g_com_draw_status draw_status
, decode(g_com_primary_pgm, 'Y',1, 0) pri_prgm_flag
FROM ps_g_com_assign_vw@commissions c1,
(SELECT MAX (effdt) effdt_max
FROM ps_g_com_assign_vw@commissions c2
WHERE c1.g_com_bu_entity = c2.g_com_bu_entity
AND c1.g_com_rep_cd = c2.g_com_rep_cd) t2
WHERE effdt = t2.effdt_max;
Similar Messages
-
Please help to modifiy this query for better performance
Please help to rewrite this query for better performance. This is taking long time to execute.
Table t_t_bil_bil_cycle_change contains 1200000 rows and table t_acctnumberTab countains 200000 rows.
I have created index on ACCOUNT_ID
Query is shown below
update rbabu.t_t_bil_bil_cycle_change a
set account_number =
( select distinct b.account_number
from rbabu.t_acctnumberTab b
where a.account_id = b.account_id
Table structure is shown below
SQL> DESC t_acctnumberTab;
Name Type Nullable Default Comments
ACCOUNT_ID NUMBER(10)
ACCOUNT_NUMBER VARCHAR2(24)
SQL> DESC t_t_bil_bil_cycle_change;
Name Type Nullable Default Comments
ACCOUNT_ID NUMBER(10)
ACCOUNT_NUMBER VARCHAR2(24) YIshan's solution is good. I would avoid updating rows which already have the right value - it's a waste of time.
You should have a UNIQUE or PRIMARY KEY constraint on t_acctnumberTab.account_id
merge rbabu.t_t_bil_bil_cycle_change a
using
( select distinct account_number, account_id
from rbabu.t_acctnumberTab
) t
on ( a.account_id = b.account_id
and decode(a.account_number, b.account_number, 0, 1) = 1
when matched then
update set a.account_number = b.account_number -
How can we rewrite this query for better performance
Hi All,
The below query is taking more time to run. Any ideas how to improve the performance by rewriting the query using NOT EXITS or any other way...
Help Appreciated.
/* Formatted on 2012/04/25 18:00 (Formatter Plus v4.8.8) */
SELECT vendor_id
FROM po_vendors
WHERE end_date_active IS NULL
AND enabled_flag = 'Y'
and vendor_id NOT IN ( /* Formatted on 2012/04/25 18:25 (Formatter Plus v4.8.8) */
SELECT vendor_id
FROM po_headers_all
WHERE TO_DATE (creation_date) BETWEEN TO_DATE (SYSDATE - 365)
AND TO_DATE (SYSDATE))
ThanksTry this one :
This will help you for partial fetching of data
SELECT /*+ first_rows(50) no_cpu_costing */
vendor_id
FROM po_vendors
WHERE end_date_active IS NULL
AND enabled_flag = 'Y'
AND vendor_id NOT IN (
SELECT vendor_id
FROM po_headers_all
WHERE TO_DATE (creation_date) BETWEEN TO_DATE (SYSDATE - 365)
AND TO_DATE (SYSDATE))
overall your query is also fine, because, the in this query the subquery always contain less data compare to main query. -
How to tune this query for the improve performance ?
Hi All,
How to tune this query for the improve performance ?
select a.claim_number,a.pay_cd,a.claim_occurrence_number,
case
when sum(case
when a.payment_status_cd ='0'
then a.payment_est_amt
else 0
end
)=0
then 0
else (sum(case
when a.payment_status_cd='0'and a.payment_est_amt > 0
then a.payment_est_amt
else 0
end)
- sum(case
when a.payment_status_cd<>'0'
then a.payment_amt
else 0
end))
end as estimate
from ins_claim_payment a
where a.as_of_date between '31-jan-03' and '30-aug-06'
and ( a.data_source = '25' or (a.data_source between '27' and '29'))
and substr(a.pay_cd,1,1) IN ('2','3','4','8','9')
group by a.claim_number, a.pay_cd, a.claim_occurrence_number
Thank you,
MckaMcka
As well as EXPLAIN PLAN, let us know what proportion of rows are visited by this query. It may be that it is not using a full table scan when it should (or vice versa).
And of course we'd need to know what indexes are available, and how selective they are for the predicated you have in this query ...
Regards Nigel -
Hi, could you please tell me if I can install any SAP trial version for MAC OS?
Hi, could you please tell me if I can install any SAP trial version for MAC OS? I am newer on this
Hello Cielo,
You can install or use SAP free trial using VM machine
Windows for Mac Desktop Virtualization - Try Fusion Free: VMware Fusion | VMware India
And you can download prepacked /pre installed sap machine from SDN
http://sdnweb.sdn.sap.com/sapbackoffice/public/SAPStoreSolutions.aspx
I am using SAP application server using VM machine->Fusion6 and prepacked trial version.
Thanks !
With regards,
Amit -
Help to rewirte query for best performance
Hi All,
can you kindly help me to rewirte the below mentioned query for best performance. this is taking more than 20 min in our production server.
SELECT cp.name,mis.secondary_type U_NAME,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-161,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-154,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-154,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-147,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-147,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-140,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-140,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-133,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-133,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-126,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-126,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-119,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-119,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-112,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-112,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-105,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-105,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-98,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-98,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-91,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-91,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-84,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-84,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-77,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-77,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-70,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-70,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-63,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-63,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-56,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-56,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-49,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-49,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-42,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-42,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-35,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-35,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-28,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-28,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-21,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-21,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-14,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-14,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-7,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage
FROM mis_event_audit mis,USER u,com_pros cp where
mis.user_id=u.email_address and u.cp_id=cp.cp_id
and (mis.start_time between To_DATE(to_char(next_day (sysdate-161,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-7,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))
GROUP BY cp.name, mis.secondary_type;
Thanks,
krishHi, Krish,
Something like this will probably be faster, because it cuts out most of the function calls:
WITH got_cnt AS
SELECT cp.name
, mis.secondary_type AS u_name
, COUNT (mis.event_audit_id) AS cnt
, ( TRUNC (mis.start_time, 'IW')
- TRUNC (SYSDATE, 'IW')
) / 7 AS week_num
FROM mis_event_audit mis
JOIN user_table u ON mis.user_id = u.email_address -- USER is not a good table name
JOIN com_pros cp ON u.cp_id = cp.cp_id
WHERE mis.start_time >= TRUNC (SYSDATE, 'IW') - 161
AND mis.start_time < TRUNC (SYSDATE, 'IW')
GROUP BY cp.name
, mis.secondary_type
, TRUNC (mis.start_time, 'IW')
SELECT name
, secondary_type
, SUM (CASE WHEN week_num = 22 THEN cnt END) AS week_23
, SUM (CASE WHEN week_num = 21 THEN cnt END) AS week_22
, SUM (CASE WHEN week_num = 20 THEN cnt END) AS week_21
, SUM (CASE WHEN week_num = 0 THEN cnt END) AS week_1
FROM got_cnt
GROUP BY name
, secondary_type
;TRUNC (d, 'IW') is midnight on the last Monday before or equal to the DATE d. It does not depend on you NLS settings.
Whenever you're tempted to write an exprssion as complicated as
, COUNT ( CASE
WHEN ( mis.start_time BETWEEN TO_DATE ( TO_CHAR ( NEXT_DAY ( SYSDATE - 161
, 'monday'
, 'MM/DD/YYYY'
, 'MM/DD/YYYY'
AND TO_DATE ( TO_CHAR ( NEXT_DAY ( SYSDATE - 154
,'monday'
, 'MM/DD/YYYY'
, 'MM/DD/YYYY'
THEN mis.event_audit_id
END
) AS usageseek alternate ways. Oracle provides several handy functions, especially for manipulating DATEs. In particular "TO_DATE (TO_CHAR ...)" is almost never needed; think very carefully before doing a round-trip conversion like that.
Besides being more efficient, this will be easier to debug and maintain.
If you're using Oracle 11.1 (or higher), then you can also use SELECT ... PIVOT in the main query, but I doubt that will be any faster, and it might not be any simpler.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Simplify the problem as much as possible. For example, instead of posting a problem that covers the last 23 weeks, pretend that you're only interested in the last 3 weeks. You'll get a solution that's easy to adapt to any number of weeks.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the forum FAQ {message:id=9360002}
For performance problems, there's another page of the forum FAQ {message:id=9360003}, but, before you start that process, let's get a cleaner query, without so many functions.
Edited by: Frank Kulash on Oct 2, 2012 11:50 AM
Changed week_num to be non-negative -
Tunning sql sub query for better performance
I have been given the task to tune this query for better execution as presently it take a very long time execute i will appreciate if someone can help.
Thank you.
SELECT a.fid_trx_no, a.fid_seq_no,a.bcc_customer_account,
a.bcc_msid,a.fid_trx_date,a.fid_trx_type,
a.fid_trx_initial_amount,a.fid_trx_fidodollar_amount
FROM
SPOT.SPOT_FIDODOLLAR_TRX a
WHERE
a.fid_trx_status = 'PE' AND a.fid_seq_no =
(SELECT MAX(c.fid_seq_no) FROM SPOT.SPOT_FIDODOLLAR_TRX c WHERE c.fid_trx_no = a.fid_trx_no) AND
a.FID_TRX_DATE <
(SELECT MAX(b.FID_TRX_DATE) FROM SPOT.SPOT_FIDODOLLAR_TRX b wHERE
b.bcc_customer_account = a.bcc_customer_account AND fid_trx_type IN
(SELECT par_code FROM SPOT.spot_parameter where par_value=:vAccountType AND par_type='FC')
)Rob...
so many times you post this link.. i think that Oracle should put this link in an obvious place....!!!
Greetings,
Sim -
How to customize the program for maximum performance on my system?
How to customize the program for maximum performance on my system?
My system: i7-5820k processor, motherboard msi x99s gaming7, DDR4 RAM 8GB ,videocard MSI 970/What program?
Mylenium -
Can you pls correct this query :: ( In Oracle Core HRMS )
Dear all,
i have created query get result :: ( In Oracle Core HRMS )
• EE Number
• Forename
• Surname
• Dept
• Start Date
• Leave Date
• Date of Birth
• Address
• Salary (New & Existing Employee)
• Car Allowance
• Effective date (changes/updates)
• Creation Date/Update date
• Email address
• Gender
• Job Description
• Grade
• From and to date for parametres
• Last Modified Date
SELECT
papf.EMPLOYEE_NUMBER emp_no
, papf.FIRST_NAME forname
, papf.LAST_NAME surname
, replace(replace(hou.attribute1,'10-',''), '14-', '') department
, pps.date_start strt_date
, pps.actual_termination_date leave_date
, papf.DATE_OF_BIRTH dob
, pdd.ADDRESS_LINE1||''||pdd.ADDRESS_LINE2||','||pdd.ADDRESS_LINE3 Address
, ppp.proposed_salary_n salary
, papf.EFFECTIVE_START_DATE estart_date
, papf.EFFECTIVE_END_DATE eend_date
, papf.CREATION_DATE crt_date
, papf.EMAIL_ADDRESS mail_addrs
, papf.SEX GENDER
, pj.NAME Job_Des
, substr(pg.name, 1, 1) GRADE
, papf.LAST_UPDATE_DATE Last_Modified_Date
FROM per_all_people_f papf
, per_all_assignments_f paaf
, per_addresses pdd
, per_pay_proposals ppp
, per_grades pg
, pay_payrolls_f pp
, per_jobs pj
, per_periods_of_service pps
, per_person_types ppt
, per_person_type_usages_f pptu
-- , pay_element_entries_f pee
, hr_organization_units hou
WHERE papf.person_id = paaf.person_id
AND papf.person_id = pdd.person_id
AND papf.person_id = pptu.person_id
and papf.person_id = pps.person_id
and pps.period_of_service_id = paaf.period_of_service_id
AND ppp.assignment_id = paaf.assignment_id
-- AND pee.assignment_id = paaf.assignment_id
AND paaf.grade_id = pg.grade_id
AND paaf.payroll_id = pp.payroll_id
AND pptu.person_type_id = ppt.person_type_id
AND paaf.organization_id = hou.organization_id
AND pj.job_id = paaf.job_id
AND ppp.pay_proposal_id = (SELECT MAX (pay_proposal_id)
FROM per_pay_proposals
WHERE assignment_id = paaf.assignment_id)
AND pp.payroll_id = 224
AND pdd.primary_flag = 'Y'
AND pee.element_type_id = 221 for car allowance
AND papf.employee_number <> 'NONE'
AND ppt.user_person_type in ('Employee', 'Ex-employee' ,'Intern')
AND ppt.system_person_type in ('EX_EMP', 'EMP')
AND TRUNC(SYSDATE) between papf.effective_start_date and papf.effective_end_date
AND TRUNC(SYSDATE) between paaf.effective_start_date and paaf.effective_end_date
AND TRUNC(SYSDATE) between pptu.effective_start_date and pptu.effective_end_date ;
can you pls correct this
still i need to add Car Allowance and Bank details in above query pls tell me where i can get dept details in oracle core HR
Thanks all
Edited by: 981527 on Jan 30, 2013 3:41 AM
Edited by: 981527 on Jan 31, 2013 1:22 AM
Edited by: 981527 on Jan 31, 2013 1:30 AM
Edited by: 981527 on Jan 31, 2013 9:03 PM
Edited by: 981527 on Feb 1, 2013 4:50 AMI am taking a guess that 'Dept' is where the employee works, so that will be the column 'NAME' in the table HR_ALL_ORGANIZATION_UNITS; you will need to join with this table on the assignment's organization_id value
Edited to add: Whilst you're testing this, you might want to consider removing the table PAY_ELEMENT_ENTRIES_F from the table list, otherwise you can look forward to potentially large cartesian product of returned rows!
Clive
Edited by: clive_t on 31-Jan-2013 09:59 -
Whether any Standard Bex query for MIS report of PP in BW
Dear All,
Please let me know , Whether any Standard Bex query is available for MIS report of PP in BW.
Thanks
Regards,
Sai.Dear All,
Please let me know , Whether any Standard Bex query is available for MIS report of PP in BW.
Thanks
Regards,
Sai. -
HT201070 how can I stop getting this update for "Ditigal camera RAW"?
how can I stop getting the upgrade for ditigal camera RAW on my iMac?
Morgan R wrote:
See this thread about disable specific software update in Mountain Lion.
There is some confusion about how to apply the method in the replies to that topic. A somewhat easier to understand explanation is at http://www.macobserver.com/tmo/article/hide-a-software-update-in-os-x-mountain-l ion, among other places on the web.
Note that you may need to click on the "more" item to see individual system software updates.
That said, the others are right: the RAW format updates are tiny & it is hardly worth the effort to hide them or to worry about the disk space they use. -
Best practices for maximum performance of C# CLR scalar UDF in View
Can anyone give some tips for best performance of a C# CLR UDF on SQL 2008 R2 or SQL 2012? Including maximizing the performance of the transition to CLR. I am using it in a View. E.g.,
create myview (id, name, address) as select id, dbo.MyUDF(name), address from mytable;
In particular:
Are there any specific C# build options or source code options? The MyUDF prototype is defined as:
[Microsoft.SqlServer.Server.SqlFunction()]
public static SqlString MyUDF(SqlString data)
Is it better to build the DLL for target x64 or Any CPU?
Does the use of a specific Target Framework have any effect? (e.g., DotNet 3.5 versus DotNet 4.0 or 4.5)
Is there any way to inform SQL Server that the UDF is safe for Parallelism?
I read somewhere that using the InProc ado.net Provider might improve performance but I don't see any mention of a Provider in the documentation for Create Assembly.
Thanks for any tips.
Neil Weicher
www.netlib.com* Does the use of a specific Target Framework have any effect? (e.g., DotNet 3.5 versus DotNet 4.0 or 4.5)
Yes, if you select 4.0 or higher, the assembly will not load on SQL 2008 R2.
* Is there any way to inform SQL Server that the UDF is safe for Parallelism?
User-defined functions (save for inline) in general is a good recipe if you want to make sure that there is no parallelism. That is, the answer to your question is no, and if there is, SQL Server does not care.
* I read somewhere that using the InProc ado.net Provider might improve performance but I don't see any mention of a Provider in the documentation for Create Assembly.
Not sure what you mean here, but if you mean the context connection, this is in your code, and have nothing to do with what you put in CREATE ASSEMBLY. Except that, if you connect by some other means than the context connection, the assembly needs to have
EXTERNAL_ACCESS_PERMISSION. But are you really doing data access from your UDF?
Erland Sommarskog, SQL Server MVP, [email protected] -
How to use dynamic SQL in this case for best performance
I have the table with following columns
ID NUMBER,
DATA LONG,
TAG VARCHAR2(255)
Records in this table will be like following
1 this is an abstract ABSTRACT
1 this is author AUTHOR
1 100 PRICE
2 this is an abstract ABSTRACT
2 this is author AUTHOR
3 contract is this CONTRACT
Basically all the records with the same number constitute 1 record for another table. Tag in the above table indicates that what column it is and DATAwill have the actual data for that column. I need to populate the second table based an the above table but will not get the same number of TAGS all the time. I need to insert the values only for the columns provided in the TAG field. How will I accomplish this by dynamic sql. Do I create a loop and create two strings one with columns and one with values and then combine them and use execute immediate to insert into table? Is there an easier way to do this??
Please respond quickly.
Thanks
Bhawna
null> so which collection should i use to perform it..
so that performance is best......
Program to interfaces. That way, you can switch out implementations and test for yourself which performance is best in an actual production context. But first, write your program so that it works. Worry about refactoring for performance once your program is written and it works.
> plz send me the logic....
Give it a shot on your own first; we can help if you get stuck.
~ -
Can you set up a template for live performance in GarageBand for iPad Air?
II'm trying to set up a template for live performance using GarageBand on my iPad Air. Can anyone advise? Thanks.
QuickTime is AppleScript aware and has its own "dictionary". Many scripts and droplets have already been compiled and you can download them from this link:
http://www.apple.com/applescript/quicktime/
Some need further editing to update them to version 7 features but it's not difficult using the Script Editor app.
Tiger's new Automator app could also be used but its feature set is rather basic. Newer actions are available for download from the Mac OSX Downloads page. -
How to update this query and avoid performance issue?
Hi, guys:
I wonder how to update the following query to make it weekend day aware. My boss want the query to consider business days only. Below is just a portion of the query:
select count(distinct cmv.invoicekey ) total ,'3' as type, 'VALID CALL DATE' as Category
FROM cbwp_mv2 cmv
where cmv.colresponse=1
And Trunc(cmv.Invdate) Between (Trunc(Sysdate)-1)-39 And (Trunc(Sysdate)-1)-37
And Trunc(cmv.Whendate) Between cmv.Invdate+37 And cmv.Invdate+39the CBWP_MV2 is a materialized view to tune query. This query is written for a data warehouse application, the CBWP_MV2 will be updated every day evening. My boss wants the condition in the query to consider only business days, for example, if (Trunc(Sysdate)-1)-39 falls in weekend, I need to move the range begins from next coming business day, if (Trunc(Sysdate)-1)-37 falls in weekend, I need to move the range ends from next coming business day. but I should always keep the range within 3 business days. If there is overlap on weekend, always push to later business days.
Question: how to implement it and avoid performance issue? I am afraid that if I use a function, it greatly reduce the performance. This view already contains more than 100K rows.
thank you in advance!
Sam
Edited by: lxiscas on Dec 18, 2012 7:55 AM
Edited by: lxiscas on Dec 18, 2012 7:56 AMYou are already using a function, since you're using TRUNC on invdate and whendate.
If you have indexes on those columns, then they will not be used because of the TRUNC.
Consider omitting the TRUNC or testing with Function Based Indexes.
Regarding business days:
If you search this forum, you'll find lots of examples.
Here's another 'golden oldie': http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:185012348071
Regarding performance:
Steps to take are explained from the links you find here: {message:id=9360003}
Read them, they are more than worth it for now and future questions.
Maybe you are looking for
-
How to share catalog between two users on one iMac?
Using Photoshop elements 11: I built op my catalog, creating events, tagging people etc. Now I would like my girlfriend to also use this catalog. (I can build up a new catalog but then I lose all the events, tags etc). I put the pictures and catalog
-
Loss of Sound on Video download and Trailers.
Help Please, Recently upgraded to the latest Itunes 6. whatever and now any downlaoded videos visually work no sound and trailers are the same vieo ok no sound. Everything else is fine.....Been using Ipod and Itune year and half now this is the first
-
Sender AS2 Configuration...
Hi All, I am doing configuration on AS2 (AS2 -> File).. We are getting the EDI Messages. Thru Sender AS2 CC, how to pick the messages into XI... Please help me out ... Thanks in advance.. Regards, Vasu
-
=NOW() updates the date and time continuously, I don't want to do that. I just want the date and time in that cell to stay the same after that row is created. Seems like this would be easy, but I can't figure it out.
-
Hi, How does SAP applications handle sessions time outs in Web Dynpro for ABAP when the processing takes a long time. Can we change some configuration settings so that we can have a Web Dynpro application can run for a very long time without getting