How to shift index in a table
Hey,
My program collects 5 pieces of information per object from user. Some of the input data is in String format, rest are Integers. I create an object from this data and put in into a table. My table contains max 10 pieces of information.
I have editing options for this data, which are erase one or all pieces, or modify a piece. I erase data by simply setting the index to null. Erasing one piece is incomplete atm, here's why:
Say I have 5 pieces in table, and I erase the one with index of 0. I can't print my information because the table starts with a null value:
int index = 0;
if (table[index] != null) { System.out.println(data);} ..
My guess is that I can solve this problem by decreasing the index of pieces greater than the modified one by 1. I can imagine that I'll be using for loop here. This is where I run out of ideas: is it possible to just modify the index, or do I have to rewrite the data again?
Any help is appreciated,
br,
nomi
I think using for loop would be the easiest way (?).
I'm filling the table as simply as:
items[index] = new table (value, quality..);Using LinkedList seems a bit far fetched for me. But
again, if I am to use for loop, I think I would have
to rewrite the data to appropriate index?Why is a List far fetched? Type of List you pick depends on how you use the list (whether you want RandomAccess, etc.).
List items = new ArrayList(); // or LinkedList
items.remove(index); // Remove the item at index.To use an array:
Table [] items = new Table[20]; // whatever size
items[index] = new Table(value, quality, ...);
// To remove:
System.arraycopy(items, index, items, index+1, items.length-(index+1));
items[items.length-1] = null;
Similar Messages
-
How to create indexes using CREATE TABLE statement
Hi,
Can anyone please tell me how to create indexes using CREATE TABLE staement? This point is part SQL Expert exam (1Z0-047) and please guide me to use which books for this particular exam.
Thanks in advance.Can anyone please tell me how to create indexes using CREATE TABLE staement?e.g. creating a primary key or a unique constraint will generate indexes along with the create table syntax:
SQL> create table t (a integer primary key, b integer unique)
Table created.
SQL> select index_name, index_type, uniqueness
from user_indexes
where table_name = 'T'
INDEX_NAME INDEX_TYPE UNIQUENES
SYS_C0016575 NORMAL UNIQUE
SYS_C0016574 NORMAL UNIQUE
2 rows selected. -
How to add index to PSA table?
Hi , Experts
as title, I want to add index to PSA table.
my scenario is as below:
We have already initialized 2LIS_03_BF with NOT blcok business user(it's due to our company could not stop R/3 system, anyway), so there are 6 years data in the PSA table, it's very huge records in PSA more than 48 million records, because of we NOT stop R/3 business during initialization, so I have to search some common data between delta records and full records(it's due to this common data contain duplicate record, I need find them and delete the duplicate record and make sure the data is correct).
This is mean The selection is too expensive as it has to look for more than five thousand delta record between more than 48 million full records. fow now I have already tigger this search job use a program, but it's still run for 7 days, still not finished yet, it drive me crazy. so I mean if I can create a index for PSA table, and this action will drive the above compare work more quickly than before? or have any other way for my scenario?
Thanks in advance.
Best Regards,
BruceHi,
See the PSA Name in RSTSODS table and then in SE11 you can create Index. But the load will become slow if you don't drop the Index.
Use 2LIS_03_BX, 2LIS_03_BF, 2LIS_03_UM to 0IC_C03 Cube and design the report.
Use :See the steps how to load the data to 0IC_C03.
Treatment of historical full loads with Inventory cube
Setting up material movement/inventory with limit locking time
If it is BI 7 then for BX in in DTP in Extraction Tab you need to select Extacrion mode = NON-Cumulative option.
Thanks
Surendra Kumar Reddy Koduru -
How to create index for particular table in R3
Hi
My load is taking too much time and it leads to process over due error. Does creating indexes on table in r3 side will solve this issue? If so how can we find out on which table does this particular data source depend. I went to maintain extract structure and findout only one table is supplying data for this data source.
Is there any other factors depend to solve this.
Thanks
kkHi,
it will depend on the table.... Having an index created will speed up the loading but slow down the insert therefore slowing some process perhaps...
May I ask which table it is? And which fields would you need to index?
Are you sure that bottleneck is located in R/3? Analyze your loading time in the monitor and see if this is really the case.
Otherwise you can create index for a table in Tx SE11; first check if an index is not already created...
hope this helps,
Olivier. -
How to find indexes in sql tables
Hi i need help for how to find the indexes for the sql tables.I had some tables in sql 2005 and i need to find indexes for that tables.Can anyone will help in this isssue.
I think you can use one of the built-in db functions ... (but it depends upon which database you're using)
in sql server:
sp_helpindex tablename -
How to rebuild index on a table in a faster way
Hi All,
We have using Oracle 9.2.0.3
On weekly basis we are loading around 20-30 million of data into a table using sqlloader.
Before loading the data into the table, we are dropping all the indexes adn rebuilding the same once done.
There are 6 index on the table and rebuilding them takes around 10-11 hours.
Is there any ways to reduce the time of index rebuilding.
Rgds,
AmolDoing it that way a
alter session set skip_unusable_indexes=truemight also be necessary. -
How to use index of Oracle Table in EJB??
Hello I have a Table Department and it's index on Dpt_Name column.
I have created ejb - cmp in OC4J for Department Table.
I am getting all the data but it is not in index on department, Where I have to specify index of table in Oc4j.
Reply appriciated.
RajivRajive,
An index is used automatically by the Database for faster retrieval of data. The query optimizer in the database determines whether to use an index and which index to use for a SQL statement and you don't have to specify the index in OC4J.
If you have an index on deptname, then the index will be used when the SQL has a where clause like "where deptname = 'Personal' " or
"where deptname like 'P%' ", etc. In case of CMP, if you have a finder method called findByDeptName and then this index will be used.
For details on deciding on your indexing strategies please look at http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/appdev.920/a96590/adg06idx.htm#11977
regards
Debu Panda
oracle -
How to set index to tables?
Hi,
My database is having more than 50000 tables, I would like to set index to all my tables, please suggest me how to set index to 50000 tables...?
Thanks
Giriuser10737570 wrote:
Hi,
My DB version 10.2.0.3.0 running on IBM-AIX....Thanks for it
As is said earlier my DB consist of 50k tables.
Each table consist of millions of rows.
So, while I try to access some rows, It takes more time (especially while running long query)
Now I decided to set index to the tables by giving
create index fbind on fdtab(owner);
so that an index has been created with taking nearly 5 hours.
so there are thousands of tables left to set the index.....Its an utterly bad idea to create indexes assuming that their presence will make the queries faster. The data selection, predicates, conditions, statistics of the tables, good/bad sql and lastly, optimizer issues, they all play a very important role in the performance. Just assuming that with index creation , your queries will be faster, I don't think its a reasonable thought to have. You have got a lot of tables as per your saying , it would take huge resource and time to create indexes on all of the tables. In addition to this issue, not all the tables would be requiring the similar type of indexes as well. Some may require B-tree while others may rquire Bitmap. Also , you must note that indexes will make dmls more slower. So Ishall again suggest that you benchmark the creation of indexes with a little more care.
HTH
Aman.... -
How to get selected row index of a Table ?
hi gurus,I'm new to Webdynpro for abap
I'm displaying just Flight details in a Table so
how to get selected row index of a Table and need to be display in Message manager.Hi,
For getting the row index use the following code.
DATA lo_nd_node TYPE REF TO if_wd_context_node.
DATA lo_el_node TYPE REF TO if_wd_context_element.
DATA index TYPE i.
* navigate from <CONTEXT> to <NODE> via lead selection
lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).
lo_el_node = lo_nd_node->get_lead_selection( ).
index = lo_el_node->get_index( ).
node is the name of the node which is binded to the table.
For printing the message u can use code wizard.
Press ctrl-F7. Now Select generate message.
IN this select the method REPORT_SUCCESS
In the code now u can give index to Message text Exporting parameter. Comment receiving parameter.
Write the whole code in onLeadSelect of the table.
Regards,
Pankaj Aggarwal -
How much time it take to rebuild an index for a table with 20 millions rows
Hi all,
i need to rebuild the index of a table containing 20 000 000 row (i don't know why the other people working on this didn't think of rebuilding the index regularly, because i asked and apparently it has never been done :cry: :cry:) i am not a sql developper nor a DBA so i can't mesure how long it take to rebuild the index, does any one have an idea (aproximativly of course :aie:), the other question is there any formula to use in order to calculate how often to rebuild the indexes (i can for example retieve how much rows are delated or inserted daily ...)
Thanks again
Tahataha wrote:
:aie: that's why i am asking because i don't know (and to be sure which solution is best)
so the table is like this (the columns) :
45 varchar2, 5 timestamp, 30 Number no LOB columns, (15 indexes : 5 unique indexes and that those indexes uses at a maximum 4 columns)15 indexes - 100,000 deletes: this could mean 1,500,000 block visits to maintain index leaf blocks as the table rows are deleted. If you're unlucky this could turn into 1,500,000 physical block read requests; if you're lucky, or the system is well engineered this could be virtually no physical I/O. The difference in time could be huge. At any rate it is likely to be 1,500,000 redo entries at 250 - 300 bytes per entry for a total of about 400MB of redo (so how large are your redo logs and how many log switches are you going to cause).
yes the tables is used by an application so (update, insert ) can take place at any time
for the deletion , there is the batch which does a mass delete on the table ( 4 or 5 time each day)
You haven't answered the question - how long does it take to do a sample batch delete.
If you can enable SQL tracing, or take a before/after snapshot of v$sesstat or v$session_event for the session as it does the delete then you can get some idea of where the time is going - for all you know it might be spending most of its time waiting for a lock to do away.
>
"How many leaf blocks are currently allocated to the index(es) ?" how can i answer to this question ? may be if i check the all_objects table ?
If you keep your statistics up to date then dba_indexes is a good place, cross-checked with dba_segments, and you can use the dbms_space package for more detail. I have a code sample on my blog which allows you to compare the current size of your indexes with the size they would be if rebuilt at some specific percentage: http://jonathanlewis.wordpress.com/index-sizing/ (It's such good code that Oracle Corp. has copied it into MOS note 989186.1)
Regards
Jonathan Lewis -
How to get row index of data table in the while ValueChangeListener fired?
Hi,
i have a data table in my page, which contains various components like inputText, selectOneChoice in each row.
i am invoking a method ValueChangeListener attribute of the selectOneChoice component. I have given the autoSubmit=true for this component.
<tr:selectOneChoice id="ratingModelType"
value="#{childRatio.ratingModelType}" binding="#{pageManager.form.bindRatioType}"
valueChangeListener="#{pageManager.form.onRatingModelTypeChange}" autoSubmit="true"
contentStyle="width:150px" required="#{!childRatio.disableChildRatioRatingModelType}"
requiredMessageDetail="#{appBundle['error.ratingModelTypeShouldNotBeEmpty']}">
<f:selectItems value="#{pageManager.catalog['Rating Model Type']}" />
<tr:selectOneChoice>In that method i want to fetch the map(with all updated values) relevant to the currently modified row of the table.
Since i am not using the selectionListener or any radio buttons in the page i am not able to get the row index of the table.
somebody please tell me how to get the row index of the table, while ValueChangeListener fired?
Thanks in advance.
SubbuHi niki,
Thank you so much. With your suggestion i got the result exactly what i want.
thanks again.
--subbu -
I am using a xmltype table for parsing the xml file and then storing the tag values into someother tables.
The table syntax
CREATE GLOBAL TEMPORARY TABLE ATLAS.XML_PROCESS
XML_DATA XMLTYPE
ON COMMIT DELETE ROWS;
At a time i will parse only one xml file. And them the content will be deleted and then i will parse another xml file.
The parsing of the xml file is taking much CPU time and also it is taking more FETCH time. ( i have seen from the trace file)
Do i need to create any index on this table?
Please suggest me how can i imrove the performence.
ThanksHi
Why do you use a GTT? Just keep your xml in memory...
HTH
Chris -
How an INDEX of a Table got selected when a SELECT query hits the Database
Hi All,
How an Index got selected when a SELECT query hits the Database Table.
My SELECT query is as ahown below.
SELECT ebeln ebelp matnr FROM ekpo
APPENDING TABLE i_ebeln
FOR ALL ENTRIES IN i_mara_01
WHERE werks = p_werks AND
matnr = i_mara_01-matnr AND
bstyp EQ 'F' AND
loekz IN (' ' , 'S') AND
elikz = ' ' AND
ebeln IN s_ebeln AND
pstyp IN ('0' , '3') AND
knttp = ' ' AND
ko_prctr IN r_prctr AND
retpo = ''.
The fields in the INDEX of the Table EKPO should be in the same sequence as in the WHERE clasuse?
Regards,
VijiHi,
You minimize the size of the result set by using the WHERE and HAVING clauses. To increase the efficiency of these clauses, you should formulate them to fit with the database table indexes.
Database Indexes
Indexes speed up data selection from the database. They consist of selected fields of a table, of which a copy is then made in sorted order. If you specify the index fields correctly in a condition in the WHERE or HAVING clause, the system only searches part of the index (index range scan).
The primary index is always created automatically in the R/3 System. It consists of the primary key fields of the database table. This means that for each combination of fields in the index, there is a maximum of one line in the table. This kind of index is also known as UNIQUE. If you cannot use the primary index to determine the result set because, for example, none of the primary index fields occur in the WHERE or HAVING clause, the system searches through the entire table (full table scan). For this case, you can create secondary indexes, which can restrict the number of table entries searched to form the result set.
reference : help.sap.com
thanx. -
How to find global index in partition table
Hi guys ,
need one help
How to find global index on partition table
How to find local index on partition table
Need query
Thanks in advance
Edited by: nav on Feb 17, 2012 6:51 AMnav wrote:
Hi Solomon,
so I have to identify partition & index are created or not,
also I have check the status of index ( both global and local)So what's the problem? Table/index partition is an object, so you can query DBA_OBJECTS:
SELECT SUBOBJECT_NAME,
CREATED
FROM DBA_OBJECTS
WHERE OWNER = partitioned-table-owner
AND OBJECT_NAME = partitioned-table-name
AND CREATED >= TRUNC(SYSDATE)
/This will give you partitions created today. So if you run this right after your job (I hope your job doen't run too close to midnight), you'll get table partition name your job created. Same logic can be applied to indexes.
SY. -
How to get index of the item from table when user double click on an item
Can anyone tell me how to get the corresponding index of a table in which
elements are listed as array of strings? I am looking for the index of the
item being double-clicked on?
Thank you in advance
Cheers,
NQ.Hi NQ,
Although the question is not thouroughly clear, I can give a few suggestions. You can use the property node for table to refer to any particular row or column of the table. The correpsonding elements in the property node will be "SelStart", "SelSize" etc. Just as a side thought, the index of a table starts with (0,0).
I am attaching a test file. Please see if it helps you in figuring out what exactly you want. This example VI is just to help you try different options under property node (if you havent already tried)to get what you want.
Regards,
Sastry Vadlamani
Applications Engineer
National Instruments
Attachments:
test.vi 27 KB
Maybe you are looking for
-
Office 2013: 10 Best Features You Should Know About
The new Office 2013 has some key updates that, while aren’t quite as dramatic as theWindows 8 from Windows 7change, still have some pretty cool features for mobile and desktop. Office 2013, will ship sometime next year at prices that have not been a
-
Receiver mail adapter - Payload as a Text attachment
Hi, In my proxy to mail adapter scenario, when i want to send payload to email as a Text email, where i need to content conversion in XI (XML to Txt file) when i send payload, currently i am receiving as a XML file. I try to follow like Rushikesh Des
-
Vendor Creation from external system
Hi there, I have a requirement from the user: An external system is used for vendor registration. The current process is where users need to create the vendor manually in SAP as there is no integration between the systems. We can not make amendments
-
HT5137 new i phone 4 camera pictures are shady grey how do i fix this please!
Hi I have a new i phone 4s when i take pictures its grey and with shadows how do i fix this please!
-
HT1766 After restoring my phone it's not allowing me to activate it. What do I do?
I just restored my iPhone 4S, when trying to activate it specifically on my iPhone (through data or WiFi) it's telling me that it can't and when I connect it to iTunes a message pops up telling me it cannot connect to the iTunes store. HELP