Performance problem with selecting records from BSEG and KONV
Hi,
I am having performance problem while selecting records from BSEG and KONV table. As these two tables have large amount of data , they are taking lot of time . Can anyone help me in improving the performance . Thanks in advance .
Regards,
Prashant
Hi,
Some steps to improve performance
SOME STEPS USED TO IMPROVE UR PERFORMANCE:
1. Avoid using SELECT...ENDSELECT... construct and use SELECT ... INTO TABLE.
2. Use WHERE clause in your SELECT statement to restrict the volume of data retrieved.
3. Design your Query to Use as much index fields as possible from left to right in your WHERE statement
4. Use FOR ALL ENTRIES in your SELECT statement to retrieve the matching records at one shot.
5. Avoid using nested SELECT statement SELECT within LOOPs.
6. Avoid using INTO CORRESPONDING FIELDS OF TABLE. Instead use INTO TABLE.
7. Avoid using SELECT * and Select only the required fields from the table.
8. Avoid nested loops when working with large internal tables.
9. Use assign instead of into in LOOPs for table types with large work areas
10. When in doubt call transaction SE30 and use the examples and check your code
11. Whenever using READ TABLE use BINARY SEARCH addition to speed up the search. Be sure to sort the internal table before binary search. This is a general thumb rule but typically if you are sure that the data in internal table is less than 200 entries you need not do SORT and use BINARY SEARCH since this is an overhead in performance.
12. Use "CHECK" instead of IF/ENDIF whenever possible.
13. Use "CASE" instead of IF/ENDIF whenever possible.
14. Use "MOVE" with individual variable/field moves instead of "MOVE-
CORRESPONDING" creates more coding but is more effcient.
Similar Messages
-
Problem while selecting BELNR from BSEG
Hi Experts,
I have a report performance problem while fetching BELNR from BSEG table.
I have to print latest BELNR from BSEG where BUZID = M but at the time of execution of report, It is taking too much time (More that hour and sometimes it gets hanged).
I have also gone through the comments provided by experts for previous problems asked in this forum e.g. BSEG is a cluster table that is why data retrieval takes long time etc.
Can any one has any other idea or suggestion or any other way to solve this problem
Regards,
NeerajHi,
1) Try to create an index on BUZID field
2) Don't use SELECT/ENDSELECT statement. Instead of that extract all the concerned entries from BSEG into an internal table :
select belnr from bseg appending table itab where buzid = 'M'.
then do this :
sort itab by belnr.
describe itab lines n.
read table itab index n.
Please reward if helpful.
Regards,
Nicolas. -
Performance Problems with MS IE 6.0 and EP 7.0 (2004s)
Hello,
we have a problem with ie 6.0 webbrowser and EP 7.0 (2004s). When we open for example the theme editor in the ep-system-administration site we must wait with MS ie 6.0 webbrowser ~ 18s for the site opening. With firefox 2.0 we can open the theme editor with ~ 1s.
Have/Had anybody the same problem? - Or is this a knowing problem with ie 6.0.
We used for the network analyse the tool: httpwatch 3.2. We can see, that the ie 6.0 must wait into the all-time of 18sec. 13sec for opening the site: emptyhover.html.
- Thanks in advance for a tip !
Best Regards,
RalfHello Ameya and hello Shao,
we use the version SP12 NW 2004s. We have the this problems with a base application of portal: theme editor.
We can see in the httpWatch 3.2 analysis tool, that the ie 6.0 load a much of cache files from the client webbrowser. Could it be this problem? - I red in this forum problems with the webbrowser-parameter: "Empty Temporary Internet Files folder when browser is closed"
Thank you for your helping.
Best Regards,
Ralf -
Performance problems with SAP GUI 7.10 and BEx 3.5 Patch 400?
Hi everybody,
we installed SAP GUI 7.10 and BEx 3.5 Patch 400 and detected hugh performance problems with this version in comparison to the SAP GUI 6.40 and BEx 3.5 or BEx 7.0 Patch 800.
Does anybody detect the same problems?
Best regards,
UlliMost important question when you are talking about performance-issues:
which OC are you working on and which excel version?
ciao
Joke -
Problem with 'RP-PROVIDE-FROM-LAST' and IT0377(GB)
Greetings,
I have encountered a problem in that we have an interface from SAP to UNIPAY and this interface selects all the paydata from employees and then converts it so that it can be payed via UNIPAY. Now this in itself may sound fairly simple but the problem is the interface is selecting data from IT0377 that has been delimited and still paying the employee which is incorrect. I have debugged the interface and the problem is with 'RP-PROVIDE-FROM-LAST IT0377' which is still selecting and bringing through the data of the delimited record.
Has anybody had this problem and if so what was done to correct it ?
Thanks
Markthis macro will put the last infotype record in the header line of concerned internal table, for the given period (pn-begda and pn-endda on selection screen).
rp-provide-from-last p0377 space pn-begda pn-endda.
here in the header of internal table p0377, the last record valid for period pn-begda n pn-endda, will be put after execution of the macro statement.
i think u r looking the table 1st record in debug mode but u shud not look at 1st record instead of tht see the header line of table and use that header data.
see my dummy code below -
*& Report ZPPL_PREVEMPLOYERS *
REPORT ZPPL_PREVEMPLOYERS message-id rp
line-size 250
line-count 65.
*Program logic :- This Report is used to Download all the Previous
* Employer (IT0023) records of the employees
*eject
*& Tables and Infotypes *
tables: pernr.
infotypes: 0000,
0001,
0002,
0023.
*eject
*& Constants *
constants: c_1(1) type c value '1' ,
c_3(1) type c value '3' ,
c_i(1) type c value 'I' ,
c_x(1) type c value 'X' ,
c_eq(2) type c value 'EQ' ,
c_pl03 like p0001-werks value 'PL03'.
*eject
*& Selection-Screen *
parameters: p_file like rlgrap-filename default 'C:TempABC.xls',
p_test as checkbox default c_x .
*eject
*& Internal tables *
* Internal Table for Output
data: begin of t_output occurs 0 ,
pernr like pernr-pernr ,
nachn like p0002-nachn ,
vorna like p0002-vorna ,
orgeh_stext like p1000-stext ,
plans_stext like p1000-stext ,
begda like p0023-begda ,
endda like p0023-endda ,
land1 like p0023-land1 ,
arbgb like p0023-arbgb ,
ort01 like p0023-ort01 .
data: end of t_output .
*eject
*& Variables *
data: o_stext like p1000-stext,
p_stext like p1000-stext.
*eject
*& Initialization *
Initialization.
* Initialize Selection-Screen values
perform init_selction_screen.
*eject
*& AT Selection-screen *
at selection-screen .
* Check if Test run selected, download file name should be entered
if p_test is initial. "
if p_file is initial.
message e016 with 'Please enter file name'
'specifying complete path'.
endif.
endif.
*eject
*& Start-of Selection *
Start-of-selection.
get pernr.
clear t_output.
* Read Infotype 0
rp-provide-from-last p0000 space pn-begda pn-endda.
check pnp-sw-found eq c_1.
* Check if employee is active
check p0000-stat2 in pnpstat2. "pernr Active
* Read Infotype 1
rp-provide-from-last p0001 space pn-begda pn-endda.
check pnp-sw-found eq c_1.
* check if employee belongs to PL03
check p0001-werks in pnpwerks. "belongs to PL03
* Check if emp belongs to Active Group
check p0001-persg in pnppersg.
* Read Infotype 2
rp-provide-from-last p0002 space pn-begda pn-endda.
check pnp-sw-found eq c_1.
* Read Org Unit Text.
CALL FUNCTION 'HR_READ_FOREIGN_OBJECT_TEXT'
EXPORTING
OTYPE = 'O'
objid = p0001-orgeh
begda = p0001-begda
endda = p0001-endda
reference_date = p0001-begda
IMPORTING
object_text = o_stext
EXCEPTIONS
nothing_found = 1
wrong_objecttype = 2
missing_costcenter_data = 3
missing_object_id = 4
OTHERS = 5.
*Read Position Text.
CALL FUNCTION 'HR_READ_FOREIGN_OBJECT_TEXT'
EXPORTING
OTYPE = 'S'
objid = p0001-plans
begda = p0001-begda
endda = p0001-endda
reference_date = p0001-begda
IMPORTING
object_text = p_stext
EXCEPTIONS
nothing_found = 1
wrong_objecttype = 2
missing_costcenter_data = 3
missing_object_id = 4
OTHERS = 5.
* Gather all the required information related to the emp
move: pernr-pernr to t_output-pernr,
o_stext to t_output-orgeh_stext,
p_stext to t_output-plans_stext,
p0002-nachn to t_output-nachn,
p0002-vorna to t_output-vorna.
* Gather previous Employee details
loop at p0023.
move-corresponding p0023 to t_output.
append t_output.
endloop.
*eject
*& End-of Selection *
end-of-selection.
perform print_report.
* Downlaod the file
if not t_output[] is initial.
if p_test eq space.
perform download_file.
endif.
else.
write: 'No records selected' color col_negative.
endif.
*eject
*& Top-of-page *
Top-of-page.
* Print Header
perform print_header.
*eject
*& Form download_file
* Description :
FORM download_file .
DATA: full_file_name TYPE string,
z_akt_filesize TYPE i .
full_file_name = p_file.
* download table into file on presentation server
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = full_file_name
filetype = 'DAT'
NO_AUTH_CHECK = c_x
codepage = '1160'
IMPORTING
FILELENGTH = z_akt_filesize
CHANGING
data_tab = t_output[]
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
not_supported_by_gui = 22
error_no_gui = 23
OTHERS = 24.
IF sy-subrc NE 0.
MESSAGE e016 WITH 'Download-Error; RC:' sy-subrc.
ENDIF.
ENDFORM. " download_file
*eject
*& Form print_report
*Description:
FORM print_report .
data: i type i,
w_count type i.
sort t_output.
* Print the report
loop at t_output.
i = sy-tabix mod 2.
if i eq 0.
format color col_normal intensified on.
else.
format color col_normal intensified off.
endif.
write:/1 t_output-pernr ,
10 t_output-vorna(25) ,
35 t_output-nachn(25) ,
61 t_output-orgeh_stext ,
102 t_output-plans_stext ,
143 t_output-begda ,
154 t_output-endda ,
168 t_output-land1 ,
178 t_output-arbgb(40) ,
219 t_output-ort01 ,
249 space .
endloop.
uline.
Describe table t_output lines w_count.
Skip 2.
Write:/ 'Total No of Records Downloaded: ' color col_total,
w_count.
ENDFORM. " print_report
*eject
*& Form print_header
*Description:
FORM print_header .
skip 1.
Uline.
format Intensified on color col_heading.
write:/1 'Pers. #' ,
10 'Last Name' ,
35 'First Name' ,
61 'Org Unit' ,
102 'Position' ,
143 'Beg Date' ,
154 'End Date' ,
168 'Cntry Key' ,
178 'Prev Employer' ,
219 'City' ,
249 space .
format intensified off color off.
uline.
ENDFORM. " print_header
*eject
*& Form init_selction_screen
*Description:
FORM init_selction_screen .
refresh: pnpwerks,
pnppersg,
pnpstat2.
clear: pnpwerks,
pnppersg,
pnpstat2.
pnpwerks-sign = c_i.
pnpwerks-option = c_EQ.
pnpwerks-low = c_pl03.
append pnpwerks.
pnppersg-sign = c_i.
pnppersg-option = c_EQ.
pnppersg-low = c_1.
append pnppersg.
pnpstat2-sign = c_i.
pnpstat2-option = c_EQ.
pnpstat2-low = c_3.
append pnpstat2.
ENDFORM. " init_selction_screen -
Urgent: Performance problem with where clause using IN and an OR condition
Select statement is:
select fl.feed_line_id
from ap_expense_feed_lines_all fl
where ((:1 is not null and
fl.feed_line_id in (select distinct r2.object_id
from xxdl_pcard_wf_routing_lists r2,
per_people_f hr2
where upper(hr2.full_name) like upper(:1||'%')
and hr2.person_id = r2.person_id
and r2.fyi_list is null
and r2.sequence_number <> 0))
or
(:1 is null))
If I modify the statement to remove the "or (:1 is null))" part at the bottom of the where clause, it returns in .16 seconds. If I modify the statement to only contain the "(:1 is null))" part of the where clause, it returns in .02 seconds. With the whole statement above, it returns in 477 seconds. Anyone have any suggestions?
Explain plan for the whole statement is:
(1) SELECT STATEMENT CHOOSE
Est. Rows: 10,960 Cost: 212
FILTER
(2) TABLE ACCESS FULL AP.AP_EXPENSE_FEED_LINES_ALL [Analyzed]
(2) Blocks: 8,610 Est. Rows: 10,960 of 209,260 Cost: 212
Tablespace: APD
(6) TABLE ACCESS BY INDEX ROWID HR.PER_ALL_PEOPLE_F [Analyzed]
(6) Blocks: 4,580 Est. Rows: 1 of 85,500 Cost: 2
Tablespace: HRD
(5) NESTED LOOPS
Est. Rows: 1 Cost: 4
(3) TABLE ACCESS FULL XXDL.XXDL_PCARD_WF_ROUTING_LISTS [Analyzed]
(3) Blocks: 19 Est. Rows: 1 of 1,303 Cost: 2
Tablespace: XXDLD
(4) UNIQUE INDEX RANGE SCAN HR.PER_PEOPLE_F_PK [Analyzed]
Est. Rows: 1 Cost: 1
Thanks in advance,
PeterThanks for the reply, but I have already checked what you are suggesting and I am pretty sure those are not causing the problem. The hr2.full_name column has an upper index and the (4) line of the explain plan shows that index being used. In addition, that part of the query executes on its own quickly.
Because the sql is not displayed in an indented format on this page it is a little hard to understand the structure so I am going to restate what is happening.
My sql is:
select a_column
from a_table
where ((:1 is not null) and a_column in (sub-select statement)
or
(:1 is null))
The :1 bind variable is set to a varchar2 entered on the screen of an application.
If I execute either part of the sql without the OR condition, performance is good.
If the :1 bind variable is null with the whole sql statement (so all rows or a_table are returned), performance is still good.
If the :1 bind variable is a not-null value with the whole sql statement, performance stinks.
As an example:
where (('wa' is not null) and a_column in (sub-select statement)) -- fast
where (('wa' is null)) -- fast
where (('' is not null) and a_column in (sub-select statement) -- fast
or
('' is null))
where (('wa' is not null) and a_column in (sub-select statement) -- slow
or
('wa' is null)) -
Problem with deleting record from the report.
This is my first post here, just to let you know I just started playing with Apex.
Here we go:
I have a page with report where the link to the record I have changed with ULR to the javascript:
javascript:doDelete(#RECORD_ID#)
I have created javascript in the HTML Header of the page
<script>
function doDelete(id) {
if (confirm("Are you sure you want to delete selected record?"))
$x('P3_DEL_ID').value=id;
doSubmit('DELETE');
</script>
and finally created a process for the page On Submit - After Computations and Validations.
declare
var_id number := :p3_del_id;
begin
commit;
Delete from mytable where record_id = var_id;
commit;
end;
I don't get error messages but record is not deleted.
Thanks for help in advance.
RobertRobert,
That's the problem. With that type selected, change the value in the textbox to just: DELETE
Regards,
Dan
http://danielmcghan.us
http://sourceforge.net/projects/tapigen
http://sourceforge.net/projects/plrecur
You can reward this reply by marking it as either Helpful or Correct ;-) -
Performance problem with slow VIEW from JDBC (fast from SQL Developer)
Hi all,
I'm experiencing following problem and would like to know if someone else also hit this one before and has a suggestion how to solve it:
I have a pretty complicated SELECT statement that per definition returns only a few rows (~30). With no further optimization it takes ~20 seconds to return the full dataset in Oracle SQL Developer. If you add the */+ PUSH_PRED(name_of_some_inner_view) /* hint (hint is correct, stars got eaten by the OTN-forum syntax), the statement takes less than 0.5s to execute (still in SQL Developer). I saved the statement with the hint as VIEW. Selecting from the VIEW in SQL Developer is also fast.
Now if I call the statement from JDBC (Tomcat webapp), I can see from the server console that the statement is 1:1 100% the same as the one I execute in SQL Developer. Nevertheless it takes about 20 seconds to complete.
Here my details:
SELECT banner FROM v$version;
BANNER
Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for 32-bit Windows: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
JDBC Driver used: some old odbc14.jar as well as current odbc6.jar for 11.2.0.2.0 from http://www.oracle.com/technetwork/da...10-090769.html
SQL Developer: current version 3.2.20.09From my reading this could go wrong:
- JDBC doesn't know the VIEW's column data types and Oracle behaves mysterious because of this (=there must be more to the SELECT than just the string, some meta-information)
- For some reason the hint inside the VIEW is not used (unlikely)
I also tried a Table Function/Pipelined table and selected from it as a workaround, but the result is the same: Selecting from Function is fast from SQL Developer, but slow from JDBC. All other statements that come from JDBC are as fast as they should be. I really don't know what to think of this and where the error might be.
Is there some setting that tells Oracle not to use hints when called from JDBC?
Thank you & Best regards,
BlamaHi Bawer,
that's what I'm thinking. Unfortunately I can't post it, as it is library code (not my lib). But in the debug-output I can see the SQL-String sent to the DB (which does include the hint).
But I find the 2nd option you mention more likely anyway: Even if I put the hint into a VIEW and select from the view, the time-difference is there (it's even there if I use Table Functions/Pipelined table and select from the function).
So I'd think it is more likely that something else is happening (e.g. Oracle is configured in a way that it does not use hints when called from JDBC or similar. Or the library sets some session options in order to prevent the usage of hints). But I don't know if there is even the possibility of doing so.
Does the Oracle JDBC driver have the option to set these options?
Does the Oracle DB have the option to set sth. like "ALTER SESSION SET dontUseHints = 'Y';" -
Problem with reading data from screen and inserting in table
hi ther,
im new to abap-webdyn pro. can anyone suggest how to read data from screen and insert into table when press 'ADD' button.
i done screen gui , table creation but problems with action. what the content of acton add.
is ther any link that helps me or tut??
thankx in advance!
regardsHi,
Create a context node for the screen fields for which you want to enter the values with cardinality 1.1.....
Now in the layout of your view bind the screen input fields to that context node(attributes) to the value property of the input fields...
Now in the action of ADD button....
--> go the wizard and select the read node button and select the node which you have created it generates the auto code for you.....
for example if the node is contains aone attribute like MATNR
reading the node from wizard will generate the code as....
DATA lo_nd_matnr TYPE REF TO if_wd_context_node.
DATA lo_el_matnr TYPE REF TO if_wd_context_element.
DATA ls_matnr TYPE wd_this->element_matnr.
DATA lv_matnr TYPE wd_this->element_matnr-matnr.
* navigate from <CONTEXT> to <MATNR> via lead selection
lo_nd_matnr = wd_context->get_child_node( name = wd_this->wdctx_matnr ).
* @TODO handle non existant child
* IF lo_nd_matnr IS INITIAL.
* ENDIF.
* get element via lead selection
lo_el_matnr = lo_nd_matnr->get_element( ).
* @TODO handle not set lead selection
IF lo_el_matnr IS INITIAL.
ENDIF.
* get single attribute
lo_el_matnr->get_attribute(
EXPORTING
name = `MATNR`
IMPORTING
value = lv_matnr ).
here the variable lv_matnr will contain the entered value......
now you can use this value for further process.
Thanks,
Shailaja Ainala. -
Performance problem with select from _DIFF view
Hi,
we have a versioned table with more then one million records. We use the DBMS_WM.SetDiffVersions procedure and select from DIFF view to get data differences between two workspaces. The problem is that the select from the DIFF view is very slow. I takes more than 15 minutes. Has anybody an idea why it consumes so much time? Is there any way how to improve it?
Thanks and regards
OndrejHi,
This can be due to any number of things, but is typically caused by an inefficient optimizer plan. Make sure that statistics on the _LT table have been recently analyzed.
Also the following information would be useful:
1. What is the relationship of the workspaces that you are trying to compare (parent/child, children of the same parent, etc) ?
2. How many and of what type dml are being performed in the workspaces ?
3. What version of Workspace Manager are you using and what is the version of the database ?
4. What is the time needed to select from the _DIFF view based on the primary key ?
Regards,
Ben -
Performance problem in select data from data base
hello all,
could you please suggest me which select statement is good for fetch data form data base if data base contain more than 10 lac records.
i am using SELECT PACKAGE SIZE n statement, but it's taking lot of time .
with best regards
srinivas rathodHi Srinivas,
if you have huge data and selecting ,you could decrease little bit time if you use better techniques.
I do not think SELECT PACKAGE SIZE will give good performance
see the below examples :
ABAP Code Samples for Simple Performance Tuning Techniques
1. Query including select and sorting functionality
tables: mara, mast.
data: begin of itab_new occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
mtart like mara-mtart,
matkl like mara-matkl,
werks like mast-werks,
aenam like mast-aenam,
stlal like mast-stlal,
end of itab_new.
select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
into table itab_new from mara as f inner join mast as g on
fmatnr = gmatnr where gstlal = '01' order by fernam.
Code B
tables: mara, mast.
data: begin of itab_new occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
mtart like mara-mtart,
matkl like mara-matkl,
werks like mast-werks,
aenam like mast-aenam,
stlal like mast-stlal,
end of itab_new.
select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
into table itab_new from mara as f inner join mast as g on f~matnr =
gmatnr where gstlal = '01'.
sort itab_new by ernam.
Both the above codes essentially do the same function, but the execution time for code B is considerably lesser than that of Code A. Reason: The Order by clause associated with a select statement increases the execution time of the statement, so it is profitable to sort the internal table once after selecting the data.
2. Performance Improvement Due to Identical Statements Execution Plan
Consider the below queries and their levels of efficiencies is saving the execution
tables: mara, mast.
data: begin of itab_new occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
mtart like mara-mtart,
matkl like mara-matkl,
werks like mast-werks,
aenam like mast-aenam,
stlal like mast-stlal,
end of itab_new.
select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
into table itab_new from mara as f inner join mast as g on f~matnr =
gmatnr where gstlal = '01' .
sort itab_new.
select fmatnr fernam
fmtart fmatkl gwerks gaenam g~stlal
into table itab_new from mara as
f inner join mast as g on f~matnr =
gmatnr where gstlal
= '01' .
Code D (Identical Select Statements)
tables: mara, mast.
data: begin of itab_new occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
mtart like mara-mtart,
matkl like mara-matkl,
werks like mast-werks,
aenam like mast-aenam,
stlal like mast-stlal,
end of itab_new.
select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
into table itab_new from mara as f inner join mast as g on f~matnr =
gmatnr where gstlal = '01' .
sort itab_new.
select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
into table itab_new from mara as f inner join mast as g on f~matnr =
gmatnr where gstlal = '01' .
Both the above codes essentially do the same function, but the execution time for code B is considerably lesser than that of Code A. Reason: Each SQL statement during the process of execution is converted into a series of database operation phases. In the second phase of conversion (Prepare phase) an execution plan is determined for the current SQL statement and it is stored, if in the program any identical select statement is used, then the same execution plan is reused to save time. So retain the structure of the select statement as the same when it is used more than once in the program.
3. Reducing Parse Time Using Aliasing
A statement which does not have a cached execution plan should be parsed before execution; this parsing phase is a highly time and resource consuming, so parsing time for any sql query must include an alias name in it for the following reason.
1. Providing the alias name will enable the query engine to resolve the tables to which the specified fields belong to.
2. Providing a short alias name, (a single character alias name) is more efficient that providing a big alias name.
Code E
select jmatnr jernam jmtart jmatkl
gwerks gaenam g~stlal into table itab_new from mara as
j inner join mast as g on jmatnr = gmatnr where
g~stlal = '01' .
In the above code the alias name used is j .
4. Performance Tuning Using Order by Clause
If in a SQL query you are going to read a particular database record based on some key values mentioned in the select statement, then the read query can be very well optimized by ordering the fields in the same order in which we are going to read them in the read query.
Code F
tables: mara, mast.
data: begin of itab_new occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
mtart like mara-mtart,
matkl like mara-matkl,
end of itab_new.
select MATNR ERNAM MTART MATKL from mara into table itab_new where
MTART = 'HAWA' ORDER BY MATNR ERNAM MTART MATKL.
read table itab_new with key MATNR = 'PAINT1' ERNAM = 'RAMANUM'
MTART = 'HAWA' MATKL = 'OFFICE'.
Code G
tables: mara, mast.
data: begin of itab_new occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
mtart like mara-mtart,
matkl like mara-matkl,
end of itab_new.
select MATNR ERNAM MTART MATKL from mara into table itab_new where
MTART = 'HAWA' ORDER BY ERNAM MATKL MATNR MTART.
read table itab_new with key MATNR = 'PAINT1' ERNAM = 'RAMANUM'
MTART = 'HAWA' MATKL = 'OFFICE'.
In the above code F, the read statement following the select statement is having the order of the keys as MATNR, ERNAM, MTART, MATKL. So it is less time intensive if the internal table is ordered in the same order as that of the keys in the read statement.
5. Performance Tuning Using Binary Search
A very simple but useful method of fine tuning performance of a read statement is using Binary search addition to it. If the internal table consists of more than 20 entries then the traditional linear search method proves to be more time intensive.
Code H
select * from mara into corresponding fields of table intab.
sort intab.
read table intab with key matnr = '11530' binary search.
Code I
select * from mara into corresponding fields of table intab.
sort intab.
read table intab with key matnr = '11530'.
Thanks
Seshu -
Problem with displaying records from the database in a table ui element
Hi,
Iam creating an application which retrieves data from an oracle database. Iam able to connect to the database and retrieve the data in a result set. Then I try to set these values in a context node as follows,
while (resultSet.next()) {
String name = result.getString(1);
String EmpId = result.getString(2);
IEmpNode node = wdContext.nodeEmp();
IEmpElement el = node.createEmpElement();
el.setName(name);
el.setEmpId(EmpId);
node.addElement(el);
where the context structure is emp(node)
---name(attribute)
---empId(attribute)
Then I have bound the node emp to a table ui element.If I try to deploy this it comes up with Internal Server error.
But if try this way, without creating a node, only with attributes name and empId,
wdContext.currentContextElement.setName(name);
wdContext.currentContextElement.setEmpId(EmpId);
and binding the attributes to inputfields in the view, Iam able to see the last record in the database table.
So where am I going wrong while using the table ui element?
Regards,
RachelHi
Try this
//Create the node in outer of while loop and bind to Table UIElement
IEmpNode node = wdContext.nodeEmp();
while (resultSet.next()) {
String name = result.getString(1);
String EmpId = result.getString(2);
IEmpElement el = wdContext.createEmpElement();
el.setName(name);
el.setEmpId(EmpId);
node.addElement(el);
Kind Regards
Mukesh -
Problem with action script from Schewe and Frasier book.
I am working on a Photoshop CS3 action script to
open raw files, do a couple of modifications
in Camera Raw, exit camera raw and save
the file as a jpeg.
I think this should work, because I am working
on an example out of "Camera raw with Adobe
Photoshop CS3" by Schewe and Frasier which
shows the step recorded.
See page 344 of Schewe and Frasier.
In figure 9-11 you see, after the open
statement, 10 lines of details like
"As camera raw"
"Model:Canon 350d" etc.
I get the file path and name line, but
none of the other details reflecting
actions in Camera Raw.
The problem is that in setting up the action, none
of the steps done in camera raw after I do the
open get recorded.
And it works in my old CS version !
Out of frustration I repeated the action
script creation in my old CS version and
it worked fine.
Any idea where I am screwing up ?Crappy format justification:
I sometimes have a day of family
type pictures that are in raw format
that I want to put up on the internet
quickly. I would like to be able to
apply the "Auto" feature, as in general
it seems to be pretty good for something
quick.
OK, it sorta works in CS, go here
http://www.angelplace.net/photos/sample.jpg
It sets up all of the details and gets the
"As camera raw" but opens the .dng file
rather than the Camera raw window.
The point is, these important settings
seem to be saved, which does not happen
in CS3. -
HT1414 Problems with downloading music from Icloud and issues with appStore
Iphone 5:
connection probelms with Icloud, Appstore and Itunes.
Already reinstalled the whole phone
Same appleID on Iphone 4 has no probelms
All software is up te date.
Internetconnection WIFI is oke
Restart Iphone wont help
What else to do to stop my phone getting stuck every time i want to get a song from the Icloud or download an App.File>Burn Playlist to Disc
-
Problems with retrieving data from tables with 240 and more records
Hi,
I've been connecting to Oracle 11g Server (not sure exact version) using Oracle 10.1.0 Client and O10 Oracle 10g driver. Everything was ok.
I installed Oracle 11.2.0 Client and I started to have problems with retrieving data from tables.
First I used the same connection string, driver and so on (O10 Oracle 10g) then I tried ORA Oracle but with no luck. The result is like this:
I'm able to connect to database. I'm able to retrieve data but from small tables (e.g. with 110 records it works perfectly using both O10 and ORA drivers). When I try to retrieve data from tables with like 240 and more records retrieval simply hangs (nothing happens at all - no error, no timeout). Application seems to hang forever.
I'm using Powerbuilder to connect to Database (either PB10.5 using O10 driver or PB12 using ORA driver). I used DBTrace, so I see that query hangs on the first FETCH.
So for the retrievals that hang I have something like:
(3260008): BIND SELECT OUTPUT BUFFER (DataWindow):(DBI_SELBIND) (0.186 MS / 18978.709 MS)
(3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=0
(3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=1
(3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=0
(3260008): EXECUTE:(DBI_DW_EXECUTE) (192.982 MS / 19171.691 MS)
(3260008): FETCH NEXT:(DBI_FETCHNEXT)
and this is the last line,
while for retrievals that end, I have FETCH producing time, data in buffer and moving to the next Fetch until all data is retrieved
On the side note, I have no problems with retrieving data either by SQL Developer or DbVisualizer.
Problems started when I installed 11.2.0 Client. Even if I want to use 10.0.1 Client, the same problem occurs. So I guess something from 11.2.0 overrides 10.0.1 settings.
I will appreciate any comments/hints/help.
Thank you very much.pgoel wrote:
I've been connecting to Oracle 11g Server (not sure exact version) using Oracle 10.1.0 Client and O10 Oracle 10g driver. Everything was ok.Earlier (before installing new stuff) did you ever try retrieving data from big tables (like 240 and more records), if yes, was it working?Yes, with Oracle 10g client (before installing 11g) I was able to retrieve any data, either it was 10k+ records or 100 records. Installing 11g client changed something that even using old 10g client (which I still have installed) fails to work. The same problem occur no matter I'm using 10g or 11g client now. Powerbuilder hangs on retrieving tables with more than like 240 records.
Thanks.
Maybe you are looking for
-
Connecting Apple TV to an Acer H5380BD DLP Projector?
Having trouble connect Apple TV to an Acer H5380BD DLP Projector. It is currently connected with an HDMI cable to projector. I played a purchased movie once with the same HDMI cable/connection and it worked fine. The next day I tried to watch the sam
-
Ram problem! (msi z68-gd80,g3)
Hey there. have a problem with my new ripjaw x series ram 1866. ( and all other ram) Tried installing all 16 gb of it earlier today and apparently only the first blue and black ram slot work. Before i updated my bios to the newest one the pc wouldn't
-
Is there a way to prevent time capsule from accessing ****?
Just wondering if there is any way to block access to certain sites or all sites accessed through Time Capsule.
-
I'm using Labview 8.2 with Internet toolkit. I'd like to connect to multiple FTP sites, and download files from all sites simultaneously. I would simply use parallel cycles to do that, but it's not possible because the toolkit's FTP VIs are not reent
-
Error: Request for resource at
Hi, I am getting following error, Kindly help me to resolve this. Error: Request for resource at http://dwm3va-inst1:1111/soap/rpc by requestor from http://localhost:8080/giftCardDashBoard/GiftCardDashBoard.swf is denied due to lack of policy file pe