EL expression to set row at particular index as selected row
Hi,
What should be the EL expression to set row at index 'i' as selected row in a tree binding.
I tried *#{bindings.treeBinding.collectionModel.selectedRow[i]}* . But it doesn't work.
I also want to make the selected row as current. Will *#{bindings.treeBinding.collectionModel.makeCurrent}* work?
Thanks
KK
Hi,
create a managed bean that returns the selected RowKeys for the tree. See this example:
http://www.oracle.com/technetwork/developer-tools/adf/learnmore/61search-in-rendered-trees-177577.pdf
It searches for a specific label in a tree and marks it as selected
Frank
Similar Messages
-
Oracle insists on using particular index in SELECT -- HELP!!!
Here's the situation: Back in November, I wrote a report program that contained the following SELECT statement on SAP table FMIFIIT:
* Get data from the FMIFIIT table.
SELECT trbtr
fmbelnr
fmbuzei
fonds
fistl
farea
measure
fipex
zhldt
sgtxt
grant_nbr
FROM fmifiit
INTO TABLE it_fmifiit_data
WHERE zhldt >= p_bpdte AND
zhldt <= p_epdte AND
fistl IN r_fndctr AND
fistl BETWEEN '4011000000' AND '4013999999' AND
fonds IN r_fund AND
fipex BETWEEN '500000' AND '599999' AND
measure <> 'GRANT RELEVANT' AND
measure IN s_rio AND
wrttp NOT IN ('51','60','81') AND
stats = ' '.
I ran into time-out issues with this statement, so a new index ("Z5") was created on the following fields: ZHLDT, FISTL, FONDS, and FIPEX. This was the 11th custom index added to the table. The program was re-run, the statement picked up the new index, and it ran much faster. Problem solved.
Fast-forward to this week. I wrote a new report program that used a SELECT statement virtually identical to the one above. It looks like this:
* Get FMIFIIT data.
SELECT gjahr
knbelnr
knbuzei
measure
trbtr
fmbelnr
fmbuzei
fonds
fistl
farea
fipex
zhldt
sgtxt
FROM fmifiit
INTO TABLE it_fmifiit
WHERE zhldt >= p_bpdte AND
zhldt <= p_epdte AND
fistl IN r_fndctr AND
fonds IN r_fund AND
fipex BETWEEN '500000' AND '599999' AND
measure <> 'GRANT RELEVANT' AND
measure IN s_rio AND
wrttp NOT IN ('51','60','81') AND
stats = ' '.
Again, the program began running into time-out issues on this statement. I did a trace using ST05, and I found that the system was choose index "3" (FONDS, FIPEX, FIPOS) instead of the obviously-better "Z5" index created a few months ago.
I tried all kinds of things to figure out why it was choosing "3" to no avail. Basis even re-ran statistics on the FMIFIIT table, but that didn't work. Right now, my only option is to add an Oracle hint to the SELECT statement to force it to use index "Z5". In our DEV system, I've used SE30 to verify that this definitely improves the timing bottleneck that occurs when "3" is used.
I've only been an ABAP programmer for a few years now, and this one is technically beyond my knowledge. I don't know what else to try, and I don't know how to determine why the system keeps choosing the index it does. It's especially frustrating when the SELECT statement is so similar to the one from above, and in that case, it DOES pick up the "Z5" index.
Does anyone have any information/strategies/suggestions? At this point, I'm all ears.
Thanks so much!
DaveHi Dave,
based on the query I cannot share your view that there is an obvious choice.
In fact the best index choice depends on what your data looks like and how are the In-lists filled.
Maybe the range conditions are very useful, maybe the in-lists are the most selective criteria.
As a detailed analysis of this is a bit heavy to be done via this forum, why don't you just implement the hint and live happily with it?
Since you find your index sensible and have proven that it leads to better performance, you obviously know more about your data than Oracle does by the statistics.
Now you can either try and learn how the Oracle CBO works (there are notes and books available on this topic) or you just use your workaround although you may not exactly understand the reasons for the problem.
In general - if this would be a support message - I would ask you to ensure that all parameter recommendations are implemented and all CBO patches are installed.
Then I'd use the sql-statement data collection script (there's a sap note containing this script - just search for 'sql_id') to gather much of the relevant data.
And then I'd have to look into the data and figure out what's behind the CBOs decision.
As you wrote that you're rather on the ABAP side of live this effort may not necessarily be worthwhile when you have a proven workaround at hand.
regards,
Lars -
INSERTING A VALUES IN A DDIC TABLE AT A PARTICULAR INDEX VIA WORKAREA
HI ALL
Can I INSERT a value at a particular index in a DDIC table via a workarea with similar structure.??
like if I have a DDIC table with four feilds and creating a internal table and a workarea with similar structure.
after fetching the values from DDIC table to our internal table and making some changes or wants to insert a values at a particular index. Then Cal I write like:
INSERT WA INTO zMARA INDEX 2.
IS IT WRITE?
OR PLEASE SUGGEST ME THE CORRECT CODE.You can insert or rather update the row of table desired by using Primary key combination..
A Db table will have at least one primary key. So first select the desired record to be updated using
unique combination of primary key to get the row you want to modify in work area then change the
value of that field in work are and then use MODIFY db table from workarea.. Remembr you can't change primary key
If key combination is not found in DB table mentioned in work area then it will insert the row in ZABC..
Code..
consider ZABC having 2 fileds AA and BB, then consider AA as primary key.. and BB as normal field..
Consider row having value AA = 1 and BB = 2.
data: wa_ZABC type ZABC.
data: i_zabc type table of zabc with header line.
Select single * from ZABC into wa_zabc where AA = '1'.
wa_zabc-bb = '3'.
modify ZABC from wa_zabc.
if you want to change multiple lines in internal table and then update in DB table then use
Modify ZABC from table i_zabc. after selecting value of zabc in i_zabc and then change
value by loop .. endloop and then apply the Modify statement..
Hope this solves your query..
Regards,
Uday Desai. -
Set row - permanent link possible?
Hello,
I need to find I way to link to a page with a spry data set displaying a specific content, I need this link to be permanent.
This is the page URL:
http://www.stefanoreboli.com/index.html
I can call this URL displaying a specific Content A using set row (SpryURLUtils.js):
http://www.stefanoreboli.com/index.html?row=2
The problem is that I'm adding and deleting datas so that Content A tomorrow will be no more at row=2.
Can I link to this content in a permanent way with set row or another method, ex. passing other XML parameters?
Thanks
This is the XML node:
<item>
<type>photo</type>
<code>1002_in_kus</code>
<projectcode>kumbh</projectcode>
<cathegory>feature</cathegory>
<year>2010</year>
<link><![CDATA[naga sadhus <em>kumbh mela</em>]]></link>
<title><![CDATA[<h1><strong>naga sadhus</strong> kumbh mela 2010 haridwar</h1>]]></title>
<project><![CDATA[kumbh mela]]></project>
<text><![CDATA[]]></text>
<display><![CDATA[
<embed src="works/photography/main.swf" FlashVars="xmlPath=works/photography/nagasadhus/settings.xml" width="540" height="540" type="application/x-shockwave-flash" bgcolor="#FFFFFF" allowscriptaccess="always">
]]></display>
<thumbnail><![CDATA[<img src="works/photography/nagasadhus/thumb.jpg">]]></thumbnail>
<info><![CDATA[]]></info>
<client><![CDATA[]]></client>
<background><![CDATA[]]></background>
</item>What about using an onclick event that changes the Xpath as follwos
/* select xpath when link is clicked */
function newXPath(thepath){
stefanoreboli.setXPath(thepath);
stefanoreboli.loadData();
the onlcick event calls newXPath(/items/item[type = 'photo' and code= '1002']) or similar. This will immediately change the data for the detail area without refreshing the page or having URL variables.
I hope this helps.
Ben -
Set row as header using applescript
I am new to AppleScript and I am writing my first script to crunch some data in numbers. I am trying to figure out how to set row one as the header row in sheet 1 using the script. Can anyone help?
Here is a script a bit more powerful that what you asked for but it's of more general use.
--{code}
--[SCRIPT set_count_of_Xers]
Enregistrer le script en tant que Script : set_count_of_Xers.scpt
déplacer le fichier ainsi créé dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
Aller au menu Scripts , choisir Numbers puis choisir “set_count_of_Xers”
En fonction des paramètres passés, le script fixera le nombre de Rangs d’en-tête, Colonnes d’en-tête ou Rangs de bas de tableau dans le tableau table_name de la feuille sheet_name du document doc_name.
--=====
L’aide du Finder explique:
L’Utilitaire AppleScript permet d’activer le Menu des scripts :
Ouvrez l’Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
Cochez la case “Afficher le menu des scripts dans la barre de menus”.
Sous 10.6.x,
aller dans le panneau “Général” du dialogue Préférences de l’Éditeur Applescript
puis cocher la case “Afficher le menu des scripts dans la barre des menus”.
--=====
Save the script as a Script: set_count_of_Xers.scpt
Move the newly created file into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
Go to the Scripts Menu, choose Numbers, then choose “set_count_of_Xers”
According to the defined parameters, the script will set the count of HEADer ROWs, HEADer COLUMNs or FOOTer ROWS in the table table_name of the sheet sheet_name in the document doc_name.
--=====
The Finder’s Help explains:
To make the Script menu appear:
Open the AppleScript utility located in Applications/AppleScript.
Select the “Show Script Menu in menu bar” checkbox.
Under 10.6.x,
go to the General panel of AppleScript Editor’s Preferences dialog box
and check the “Show Script menu in menu bar” option.
--=====
Yvan KOENIG (VALLAURIS, France)
2011/09/21
--=====
property forTests : false
true may be useful for tests. It triggers the handler select_SubMenu which list the UI elements.
false is the setting to apply when the script is finished because it runs faster.
--=====
on run
my activateGUIscripting()
This script is a general one allowing to treat the defined table
set doc_name to 1
set sheet_name to "Feuille 2"
set table_name to "Tableau 1"
set which_item to 10
set nb_Xers to 1
my setNbXers(doc_name, sheet_name, table_name, which_item, nb_Xers) (* to set 1 HEADer ROW *)
end run
--=====
which = 10 --> set count of HEADer ROWs
my setNbXers(1, "Feuille 2", "Tableau 1", 10, 1) (* to set 1 HEADer ROW *)
which = 11 --> set count of HEADer COLUMNs
my setNbXers("my doc.numbers", "Sheet 5", "Table aux", 11, 4) (* to set 4 HEADer COLUMNs *)
which = 14 --> set count of FOOTer ROWs
my setNbXers("ASCII.numbers", "Sheet of paper", "TableTop", 14, 3) (* to set 3 FOOTer ROWs *)
on setNbXers(docName, sheetName, tableName, whichItem, nbXers)
my selectTable(docName, sheetName, tableName)
if forTests then
my select_SubMenu("Numbers", 6, whichItem, nbXers + 1)
else
my selectSubMenu("Numbers", 6, whichItem, nbXers + 1)
end if
end setNbXers
--=====
set { dName, sName, tName, rowNum1, colNum1, rowNum2, colNum2} to my get_SelParams()
tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
on get_SelParams()
local d_name, s_name, t_name, row_num1, col_num1, row_num2, col_num2
tell application "Numbers" to tell document 1
set d_name to its name
set s_name to ""
repeat with i from 1 to the count of sheets
tell sheet i to set maybe to the count of (tables whose selection range is not missing value)
if maybe is not 0 then
set s_name to name of sheet i
exit repeat
end if -- maybe is not 0
end repeat
if s_name is "" then
if my parleAnglais() then
error "No sheet has a selected table embedding at least one selected cell !"
else
error "Aucune feuille ne contient une table ayant au moins une cellule sélectionnée !"
end if
end if
tell sheet s_name to tell (first table where selection range is not missing value)
tell selection range
set {top_left, bottom_right} to {name of first cell, name of last cell}
end tell
set t_name to its name
tell cell top_left to set {row_num1, col_num1} to {address of its row, address of its column}
if top_left is bottom_right then
set {row_num2, col_num2} to {row_num1, col_num1}
else
tell cell bottom_right to set {row_num2, col_num2} to {address of its row, address of its column}
end if
end tell -- sheet…
return {d_name, s_name, t_name, row_num1, col_num1, row_num2, col_num2}
end tell -- Numbers
end get_SelParams
--=====
on parleAnglais()
local z
try
tell application "Numbers" to set z to localized string "Cancel"
on error
set z to "Cancel"
end try
return (z is not "Annuler")
end parleAnglais
--=====
on decoupe(t, d)
local oTIDs, l
set oTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to d
set l to text items of t
set AppleScript's text item delimiters to oTIDs
return l
end decoupe
--=====
on activateGUIscripting()
(* to be sure than GUI scripting will be active *)
tell application "System Events"
if not (UI elements enabled) then set (UI elements enabled) to true
end tell
end activateGUIscripting
--=====
==== Uses GUIscripting ====
on selectTable(theDoc, theSheet, theTable)
local maybe, targetSheetRow, rowIndex, r
try
tell application "Numbers"
activate
set theDoc to name of document theDoc (* useful if the passed value is a number. Checks also that we passed the name of an open doc *)
end tell -- Numbers
on error
if my parleAnglais() then
error "The spreadsheet “" & theDoc & "” is not open !"
else
error "Le tableur « " & theDoc & " » n’est pas ouvert ! "
end if -- my parleAnglais
end try
try
tell application "Numbers" to tell document theDoc
set theSheet to name of sheet theSheet (* useful if the passed value is a number and check the availability of theSheet if it’s a string *)
end tell -- Numbers
on error
if my parleAnglais() then
error "The sheet “" & theSheet & "” is unavailable in the spreadsheet “" & theDoc & "” !"
else
error "La feuille « " & theSheet & " » n’existe pas dans le tableur « " & theDoc & " » ! "
end if -- my parleAnglais
end try
try
tell application "Numbers" to tell document theDoc to tell sheet theSheet
set theTable to name of table theTable (* useful if the passed value is a number and check the availability of theSheet if it’s a string *)
end tell -- Numbers
on error
if my parleAnglais() then
error "The table “" & theTable & "” is unavailable in the sheet “" & theSheet & "” of the spreadsheet “" & d & "” !"
else
error "La table « " & theTable & " » n’existe pas dans la feuille « " & theSheet & " » du tableur « " & d & " » ! "
end if -- my parleAnglais
end try
set maybe to 5 > (system attribute "sys2")
tell application "System Events" to tell application process "Numbers"
tell outline 1 of scroll area 1 of splitter group 1 of splitter group 1 of window theDoc
if maybe then (* macOS X 10.4.x
'(value of attributes contains 0)': '(value of attribute "AXDisclosureLevel" is 0)' sometimes works in Tiger, sometimes not.
The only possible instances of 0 amongst the attributes are the disclosure level of a sheet row and the index of the first row, which represents a sheet anyway.
Another possibility is '(value of attribute -1 is 0)', which makes me uneasy. *)
set targetSheetRow to first row where ((value of attributes contains 0) and (value of first static text is theSheet))
else (* macOS X 10.5.x or higher *)
set targetSheetRow to first row where ((value of attribute "AXDisclosureLevel" is 0) and ((groups is {}) and (value of first static text is theSheet)) or (value of first group's first static text is theSheet))
end if -- maybe
tell targetSheetRow to set {value of attribute "AXSelected", value of attribute "AXDisclosing"} to {true, true}
-- Get the sheet row's 0-based index + 2 for the following row's 1-based index.
set r to (value of attribute "AXIndex" of targetSheetRow) + 2
repeat until (value of first static text of row r is theTable)
set r to r + 1
end repeat
set value of attribute "AXSelected" of row r to true
end tell -- outline 1 …
end tell -- System Events
end selectTable
--=====
my selectSubMenu("Pages",6, 4, 26)
==== Uses GUIscripting ====
on selectSubMenu(theApp, mt, mi, ms)
tell application theApp
activate
tell application "System Events" to tell process theApp to tell menu bar 1 to ¬
tell menu bar item mt to tell menu 1 to tell menu item mi to tell menu 1 to click menu item ms
end tell -- application theApp
end selectSubMenu
--=====
useful to get the indexs of the triggered item
my select_SubMenu("Numbers", 6, 10, 1+1) (* Table > Header rows > 1 *)
on select_SubMenu(theApp, mt, mi, ms)
tell application theApp
activate
tell application "System Events" to tell process theApp to tell menu bar 1
get name of menu bar items
01 - "Apple",
02 - "Numbers",
03 - "Fichier",
04 - "Édition",
05 - "Insertion",
06 - "Tableau",
07 - "Format",
08 - "Disposition",
09 - "Présentation",
10 - "Fenêtre",
11 - "Partage",
12 - "Aide"}
get name of menu bar item mt
-- {"Tableau"}
tell menu bar item mt to tell menu 1
get name of menu items
01 - "Insérer un rang d’en-tête au-dessus"
02 - "Insérer un rang d’en-tête en dessous"
03 - missing value
04 - "Insérer une colonne d’en-tête avant"
05 - "Insérer une colonne d’en-tête après"
06 - missing value
07 - "Supprimer le rang"
08 - "Supprimer la colonne"
09 - missing value
10 - "Rangs d’en-tête"
11 - "Colonnes d’en-tête"
12 - "Bloquer les rangs d’en-tête"
13 - "Bloquer les colonnes d’en-tête"
14 - "Rangs de bas de tableau"
15 - missing value
16 - "Ajuster les rangs au contenu"
17 - "Ajuster les colonnes au contenu"
18 - missing value
19 - "Afficher tous les rangs"
20 - "Afficher toutes les colonnes"
21 - "Activer toutes les catégories"
22 - missing value
23 - "Fusionner les cellules"
24 - "Diviser en rangs"
25 - "Diviser en colonnes"
26 - missing value
27 - "Répartir les rangs uniformément"
28 - "Répartir les colonnes uniformément"
29 - missing value -
i just bought an airport express. i set it up and was able to be detected by my macbook, but i still cant connect wirelessly. the same goes when i tried my iphone. please help!
Is the status light green?
Your Airport device may be in Bridge Mode.
Airport Utility 6:
Open Airport Utility, select the Airport Express and click Edit. Navigate to the Network tab and change Router Mode to DHCP and NAT. Then click Update on the bottom right.
Airport Utility 5:
Open Airport Utility and click Manual Setup. Navigate to the Internet icon and change Connection Sharing to Share a Public IP Address. Then click Update on the bottom right. -
How to set and retrive the index log path stored by parameter LOG_DIRECTORY
how to set and retrive the index log path stored by parameter LOG_DIRECTORY.
http://download-west.oracle.com/docs/cd/B19306_01/network.102/b14213/lsnrctl.htm#sthref72
http://download-west.oracle.com/docs/cd/B19306_01/network.102/b14213/cmctl.htm#sthref239 -
Hello.
How I can set row select from PLSQL process handler after commit.In more detail I have some set of field in my filter. I need to select all report rows which match this filter.
Thanks in advance Andrii.Hi Andrii,
I'm not sure if I understand you correct, but if your report has checkboxes, which you want to set checked when they match your filter, you could try the following:
In your report query, where you define your apex_item.checkbox add a case stement.
SELECT case when <your_filter_condition> then APEX_ITEM.CHECKBOX(1,<your_column>,'CHECKED')
else APEX_ITEM.CHECKBOX(1,<your_column>)
end case as " "
, <other_columns>
FROM <your_table>
regards,
Vincent Deelene -
How to set row height for each row
Hi
i am trying to set rowheight of row in a JTable using setRowHeight(row,rowheight)
it is not affecting on Table.but if i use setRowheight(rowheight) it applying
entire table ,please help me to solve this problem
after setRowHeight(row,rowheight), i am calling firechanged() method also ,i t will not affecting please hemp me
how to set row height at runtime in a JTableOk fine... do one thing... post ur code here let me check and tell u....
Ciya..... -
Which queries using particular index?
Hello,
Is it possible in Oracle 11gR2 to find out which queries are using or used particular INDEX?
Thanks a lot for your suggestion.
Best RegardsHello,
Thanks a lot.
I have queried what you suggested, and got 5 sql_ids, but I quickly got the EXPLAIN PLAN for all the 5 sql_ids after getting sql_text, but the index I am looking for is not in the NAME column of select * from table (dbms_xplan.display());
select distinct(sql_id) from v$sql_plan where object_owner = 'HEMANT' and object_name = '&myindex';
I am little confused now, as v$sql_plan showing 5 sqls based on myindex but no one is actually using index?
Thank you.
Best Regards -
A quick one about Oracle Indexes....
Is it possible to disable a particular index (for a period of time) but still keep it online such that all changes are still updated in the index but it is not used during queries? I don't want to rebuild the index when I enable it again.>
Is it possible to disable a particular index (for a period of time) but still keep it online such that all changes are still updated in the index but it is not used during queries? I don't want to rebuild the index when I enable it again.
>
Ther is a New Feature introduced in 11g exactly for this:
SQL> alter index <name> invisible;This will make the index invisible for the optimizer, but DML will still maintain the index. Main purpose for this is, you can check whether the index is needed before you decide to actually drop it. Should somebody complain, you bring it back instantly with
SQL> alter index <name> visible;Kind regards
Uwe
http://uhesse.wordpress.com -
Using Airport Express to set up an ad hoc network for presentations
I have to give a presentation where I will both need my MacBook Pro and iPad. I may or may not have a wireless network available (will depend on location). Is there a way that I can use an Airport Express to set up an ad hoc network and use an Apple TV for AirPlay from my iPad and laptop?
Easy to do. Just set up the AirPort Express to "Create a wireless network".
When you see the "error" message(s) that there is not an Ethernet cable plugged into the WAN port and/or no Internet connection, click "ignore" and you will have a green light on the Express.
Wireless devices will connect to the network by selecting it and entering the password. -
Looking for the last item in a string set in a particular character style
I should find each space that is the last character in a string set in a particular character style. For example, in the passage "123 456 789" (the underlined part here indicating a passage set in a particular character style), my ideal GREP search would yield a match after the digit 6.
How do this?Excellent! This works perfectly. I have used your string with the bold character formatting, and replaced the matches with [nothing], set in None style.
On second thought, I was surprised that it indeed had worked: why was the space replaced, and not deleted? Shouldn't I have used
(?<!.)(\s)(?=\w)
and replaced it with
$2 -
How to utilize index in selection statement
hi
how to utilize index in selection statement and how is it reduces performance whether another alternative is there to reduce performance .
thanksHi Suresh,
For each SQL statement, the database optimizer determines the strategy for accessing data records. Access can be with database indexes (index access), or without database indexes (full table scan).The cost-based database optimizer determines the access strategy on the basis of:
*Conditions in the WHERE clause of the SQL statement
*Database indexes of the table(s) affected
*Selectivity of the table fields contained in the database indexes
*Size of the table(s) affected
*The table and index statistics supply information about the selectivity of table fields, the selectivity of combinations of table fields, and table size. Before a database access is performed, the database optimizer cannot calculate the exact cost of a database access. It uses the information described above to estimate the cost of the database access.The optimization calculation is the amount by which the data blocks to be read (logical read accesses) can be reduced. Data blocks show the level of detail in which data is written to the hard disk or read from the hard disk.
<b>Inroduction to Database Indexes</b>
When you create a database table in the ABAP Dictionary, you must specify the combination of fields that enable an entry within the table to be clearly identified. Position these fields at the top of the table field list, and define them as key fields.
After activating the table, an index is created (for Oracle, Informix, DB2) that consists of all key fields. This index is called a primary index. The primary index is unique by definition. As well as the primary index, you can define one or more secondary indexes for a table in the ABAP Dictionary, and create them on the database. Secondary indexes can be unique or non-unique. Index records and table records are organized in data blocks.
If you dispatch an SQL statement from an ABAP program to the database, the program searches for the data records requested either in the database table itself (full table scan) or by using an index (index unique scan or index range scan). If all fields requested are found in the index using an index scan, the table records do not need to be accessed.
A data block shows the level of detail in which data is written to the hard disk or read from the hard disk. Data blocks may contain multiple data records, but a single data record may be spread across several data blocks.
Data blocks can be index blocks or table blocks. The database organizes the index blocks in the form of a multi-level B* tree. There is a single index block at root level, which contains pointers to the index blocks at branch level. The branch blocks contain either some of the index fields and pointers to index blocks at leaf level, or all index fields and a pointer to the table records organized in table blocks. The index blocks at leaf level contain all index fields and pointers to the table records from the table blocks.
The pointer that identifies one or more table records has a specific name. It is called, for example, ROWID for Oracle databases. The ROWID consists of the number of the database file, the number of the table block, and the row number within the table block.
The index records are stored in the index tree and sorted according to index field. This enables accelerated access using the index. The table records in the table blocks are not sorted.
An index should not consist of too many fields. Having a few very selective fields increases the chance of reusability, and reduces the chance of the database optimizer selecting an unsuitable access path.
<b>Index Unique Scan</b>
If, for all fields in a unique index (primary index or unique secondary index), WHERE conditions are specified with '=' in the WHERE clause, the database optimizer selects the access strategy index unique scan.
For the index unique scan access strategy, the database usually needs to read a maximum of four data blocks (three index blocks and one table block) to access the table record.
<b><i>select * from VVBAK here vbeln = '00123' ......end select.</i></b>
In the SELECT statement shown above, the table VVBAK is accessed. The fields MANDT and VBELN form the primary key, and are specified with '=' in the WHERE clause. The database optimizer therefore selects the index unique scan access strategy, and only needs to read four data blocks to find the table record requested.
<b>Index Range Scan</b>
<b><i>select * from VVBAP here vbeln = '00123' ......end select.</i></b>
In the example above, not all fields in the primary index of the table VVBAP (key fields MANDT, VBELN, POSNR) are specified with '=' in the WHERE clause. The database optimizer checks a range of index records and deduces the table records from these index records. This access strategy is called an index range scan.
To execute the SQL statement, the DBMS first reads a root block (1) and a branch block (2). The branch block contains pointers to two leaf blocks (3 and 4). In order to find the index records that fulfill the criteria in the WHERE clause of the SQL statement, the DBMS searches through these leaf blocks sequentially. The index records found point to the table records within the table blocks (5 and 6).
If index records from different index blocks point to the same table block, this table block must be read more than once. In the example above, an index record from index block 3 and an index record from index block 4 point to table records in table block 5. This table block must therefore be read twice. In total, seven data blocks (four index blocks and three table blocks) are read.
The index search string is determined by the concatenation of the WHERE conditions for the fields contained in the index. To ensure that as few index blocks as possible are checked, the index search string should be specified starting from the left, without placeholders ('_' or %). Because the index is stored and sorted according to the index fields, a connected range of index records can be checked, and fewer index blocks need to be read.
All index blocks and table blocks read during an index range scan are stored in the data buffer at the top of a LRU (least recently used) list. This can lead to many other data blocks being forced out of the data buffer. Consequently, more physical read accesses become necessary when other SQL statements are executed
<b>DB Indexex :Concatenation</b>
In the concatenation access strategy, one index is reused. Therefore, various index search strings also exist. An index unique scan or an index range scan can be performed for the various index search strings. Duplicate entries in the results set are filtered out when the search results are concatenated.
<i><b>Select * from vvbap where vbeln in ('00123', '00133', '00134').
endselect.</b></i>
In the SQL statement above, a WHERE condition with an IN operation is specified over field VBELN. The fields MANDT and VBELN are shown on the left of the primary index. Various index search strings are created, and an index range scan is performed over the primary index for each index search string. Finally, the result is concatenated.
<b>Full Table Scan</b>
<b><i>select * from vvbap where matnr = '00015'.
endselect</i></b>
If the database optimizer selects the full table scan access strategy, the table is read sequentially. Index blocks do not need to be read.
For a full table scan, the read table blocks are added to the end of an LRU list. Therefore, no data blocks are forced out of the data buffer. As a result, in order to process a full table scan, comparatively little memory space is required within the data buffer.
The full table scan access strategy is very effective if a large part of a table (for example, 5% of all table records) needs to be read. In the example above, a full table scan is more efficient than access using the primary index.
<i><b>In Brief</b></i>
<i>Index unique scan:</i> The index selected is unique (primary index or unique secondary index) and fully specified. One or no table record is returned. This type of access is very effective, because a maximum of four data blocks needs to be read.
<i>Index range scan:</i> The index selected is unique or non-unique. For a non-unique index, this means that not all index fields are specified in the WHERE clause. A range of the index is read and checked. An index range scan may not be as effective as a full table scan. The table records returned can range from none to all.
<i>Full table scan:</i> The whole table is read sequentially. Each table block is read once. Since no index is used, no index blocks are read. The table records returned can range from none to all.
<i>Concatenation:</i> An index is used more than once. Various areas of the index are read and checked. To ensure that the application receives each table record only once, the search results are concatenated to eliminate duplicate entries. The table records returned can range from none to all.
Regards,
Balaji Reddy G
***Rewards if answers are helpful -
How to get index of selected image??
hi all
I have a set of images that is displayed for the user and when he choose one image click on it and it will do sime action ... these images are stored in an array of images . How can i know the index of selected image ??i woul like to append an array of images in the screen and whenever i choose one of this images it link me to the class
Maybe you are looking for
-
Unable to load dataclass information from Sync Services
the error message keeps poping up as soon as i connect iphone to my computer. i spent 2 hours on 7/11, and 4 hours on 7/13 with apple tech support. could not solve the problem. it has been 3 days since i bought the new iphone and never been synced ye
-
ICal multiple duplicates of events created for one
Please help. I created AN event in iCal for my work calendar. Repeats M-F, 0730-1600 thru March 2014. I've changed the "hours" of some of the "events" as needed (for example, vacation time, other time-off, etc.) Instead of ONE event, each DAY is s
-
Delivery Split ( 1 STO n deliveries)
Dear all, I have a req where I need to create multiple Deliveries for one STO, there are standard pallet quantity in WM and they want to create 1 TO per delivery. there is going to be only one line item per STO. Eg: say we have a STO for 198 each pal
-
I setup my Airport time capsule. System works ok with no encription. When I introduce the WPA2 password, my MAC can't connect.
-
New chargers...
what is it with the flimsy design of these current chargers?my n91 charger doesn't work anymore, ptobably cos the charger head is messed up but i've to resort to the charger adapter that came with the phone. don't know if its like that anywhere else