Home » Developer & Programmer » Forms » Record Groups VS Table types
Record Groups VS Table types [message #117954] Mon, 02 May 2005 02:12 Go to next message
mathan
Messages: 24
Registered: March 2005
Junior Member
Hi,
In forms, I am storing some values in a plsql table(like an array). Everytime a value is chosen in the filter, I do a sequential search of the table to retrieve my values. As this is a single table the search is taking a long time.I would like to replace this with multiple run time record groups. My question is whether the storing and retrieval from record groups are in any way faster or slower than retrieval from a table? I dont know the exact row number. So I have to do a sequential read of the record group also. So it will be something like :
for i in 1..10 loop
v := get_group_char_Cell('col name',i);
end loop;

Is this faster than
for i in 1..10 loop
v := tab(i).col;
end loop;

Ps: The record group could be smaller than the table as it will be multiple. Table will be always be one.

Thanks in Advance.
Re: Record Groups VS Table types [message #118068 is a reply to message #117954] Mon, 02 May 2005 23:11 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
How much time is the search taking? If there are only 10 records I can't see that it would take much time at all.

David
Re: Record Groups VS Table types [message #118091 is a reply to message #118068] Tue, 03 May 2005 00:57 Go to previous messageGo to next message
mathan
Messages: 24
Registered: March 2005
Junior Member
This is part of an application where lots of records are stored. Hence even such a small change is very significant. Please let me know the answer!!!
Re: Record Groups VS Table types [message #118094 is a reply to message #117954] Tue, 03 May 2005 01:07 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please look at http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/05_colls.htm#19661 where they discuss PL/SQL Collections and Records.

Quote:

For associative arrays (also known as index-by tables), use the syntax:

TYPE type_name IS TABLE OF element_type [NOT NULL]
INDEX BY [BINARY_INTEGER | PLS_INTEGER | VARCHAR2(size_limit)];
INDEX BY key_type;


These indexed tables are (I think) the fastest structure that Oracle has available.

David

[Updated on: Tue, 03 May 2005 01:11]

Report message to a moderator

Re: Record Groups VS Table types [message #118328 is a reply to message #118094] Wed, 04 May 2005 07:43 Go to previous messageGo to next message
mathan
Messages: 24
Registered: March 2005
Junior Member
Hi,
Want to add one more question. If I use a GLOBAL TEMP table instead of a plsql table or a record group, would that be faster? Especially if the GLOBAL table is indexed?
Please help!
Thanks

Re: Record Groups VS Table types [message #118394 is a reply to message #117954] Wed, 04 May 2005 19:30 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please post a description of what you mean by 'GLOBAL TEMP table'. It is something with which I am not familiar.

David
Re: Record Groups VS Table types [message #119036 is a reply to message #118394] Tue, 10 May 2005 06:37 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Reported by subba lakshmi On: Tue, 10 May 2005 13:35

this is reply to david's question about temporary tables as the name suggest temporary tables can be created. data is lost when commit is given after insert(on commit delete rows). data is preserved till the session is open(on commit preserve rows).o


It's a temporary table they're talking about.

MHE
Re: Record Groups VS Table types [message #119165 is a reply to message #117954] Tue, 10 May 2005 20:34 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
That's what I thought. I know temporary tables, it was global tables with which I had trouble.

David
Previous Topic: cumulative Total of unknown number of columns........
Next Topic: how to populate an multiple list item in d2k
Goto Forum:
  


Current Time: Thu Sep 19 18:06:09 CDT 2024