Partial fields of Secondary index being used by the DB Optimizer
Hello,
I have written the following Query to select an std. SAP Index from GLPCA~1. However, when i run the SQL trace although the index is selected by the DB optimizer the results say that only 3 matching columns were used.
bold Index GLPCA~1. bold
KOKRS
RYEAR
RPRCTR
RVERS
RACCT
SELECT rldnr
rrcty
rvers
ryear
rtcur
rpmax
rbukrs
rprctr
rfarea
kokrs
racct
hslvt
hsl01
hsl02
hsl03
hsl04
hsl05
hsl06
hsl07
hsl08
hsl09
hsl10
hsl11
hsl12
kslvt
ksl01
ksl02
ksl03
ksl04
ksl05
ksl06
ksl07
ksl08
ksl09
ksl10
ksl11
ksl12
FROM glpct
INTO TABLE i_glpct
WHERE kokrs = 'BFS'
AND ryear = p_gjahr
AND rprctr IN r_prctr
AND rvers = '000'
AND racct IN r_acct.
Now i am not sure which of the above 3 fields of the where condition are being selected but probably KOKRS and RVERS are not being used by the optimizer.
Any pointers on how to make the optimizer utilize all 5 fields would be greatly appreciated.
Thanks,
Minhaj.
Hello,
I have written the following Query to select an std. SAP Index from GLPCA~1. However, when i run the SQL trace although the index is selected by the DB optimizer the results say that only 3 matching columns were used.
bold Index GLPCA~1. bold
KOKRS
RYEAR
RPRCTR
RVERS
RACCT
SELECT rldnr
rrcty
rvers
ryear
rtcur
rpmax
rbukrs
rprctr
rfarea
kokrs
racct
hslvt
hsl01
hsl02
hsl03
hsl04
hsl05
hsl06
hsl07
hsl08
hsl09
hsl10
hsl11
hsl12
kslvt
ksl01
ksl02
ksl03
ksl04
ksl05
ksl06
ksl07
ksl08
ksl09
ksl10
ksl11
ksl12
FROM glpct
INTO TABLE i_glpct
WHERE kokrs = 'BFS'
AND ryear = p_gjahr
AND rprctr IN r_prctr
AND rvers = '000'
AND racct IN r_acct.
Now i am not sure which of the above 3 fields of the where condition are being selected but probably KOKRS and RVERS are not being used by the optimizer.
Any pointers on how to make the optimizer utilize all 5 fields would be greatly appreciated.
Thanks,
Minhaj.
Similar Messages
-
Materialized view not being used in the report
I have had a materialized view (MV) for a particular report. Recently, the report definition has changed little bit, so the existing MV is not being used by the report anymore. I copied the code Discoverer's SQL Inspection and recreated the materialized view. But still it is not working. Obviously, I am missing something at the database level. Does anyone have any idea? The database is 9i and Discoverer is 9.0.2. Thank you!
The SQL that you see from the Inspect SQL option will provide you with the SQL that Discoverer sends to the database. The database then may do a query rewrite to point to an available materialized view if available. This rewrite won't be seen from the inspect sql option. You need to check at the database level to verify if a query rewrite did in fact take place.
You may want to check the section titled "Query Rewrite with Materialized Views" from Ch1 - "Introduction to the Optimizer" in the Oracle9i Database Performance Tuning Guide and Reference, Release 2 (9.2), Part Number A96533-02, available at http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96533/optimops.htm#37287
Regards
Abhinav Agarwal
Oracle Business Intelligence Product Management
http://www.oracle.com/bi
http://www.oracle.com/technology/documentation/bi_ee.html
http://www.oracle.com/technology/software/products/ias/htdocs/101320bi.html
http://oraclebi.blogspot.com/ -
I'm trying to set up my iPad2. I am entering my Apple ID and get a message that says "try another apple id, this ID is already being used. The only time I've used this Apple ID (my emal) was when I purchased a mac for my college aged child.
Thank you...I had selected the incorrect option to create an Apple ID....so backing up a few pages and doing as you stated worked!
-
How to list all the datatypes are being used in the database?
Is there any way you can list all the oracle datatypes are being used in the database?
Thanks,
ChauUse USER_TAB_COLUMNS or DBA_TAB_COLUMNS to determing various data type but USER_TAB_COLUMNS will show you what type being used by a schema user
-
Iphone 4s - how do I change the name in the contacts for the owner of the phone - it is coming up as the other person who uses the laptop - so when ringing or texting anyone 2 names are being used as the caller id on the screen
*Ralph Johns* writes:
"Your options are:
Get a trial account form @mac which will work as an iChat name after the 60 days run out but not be a email account that is valid (And is free)"
Do you mean a trial account from .Mac? (DotMac)
"Get an AIM Screen name and set it to Display what you want as you set it up.
The Screen name can be whatever yu want but you can also set it to display something else as well."
I had thought about this, but it seems other people have already chosen the screen name "pinksharkmark" and virtually every variation of it I can think of. So that isn't an option for me. As for getting it to display something else as well, do you mean that if I were to get an AIM screen name like "CromulentCat" I could somehow log in to iChat under the AIM account "CromulentCat" yet get iChat to represent me to my Buddies as "PinkSharkMark"? Because I have to admit I don't see how that can be done. It appears as if iChat displays to anyone chatting with you precisely the account name you logged in under and nothing else. So if you logged in using a .Mac account, then you are displayed as "[email protected]" while if you logged in under an AIM account, you are displayed as "CromulentCat". But that's it that's all... there is no way to change CromulentCat to PinkSharkMark.
Thanks very much for taking the time to reply, though. -
Is there a way to find out which CSS rules are being used by the different html files?
Is there a way in Dreamweaver CS3 to find out which CSS rules are being used by the different html files, sitewide?
Thanks - DaveFirefox add-on "Web Developer Toolbar" is a must have. Information > Display Div & Class details.
https://addons.mozilla.org/en-US/firefox/addon/60
Another handy Firefox Add-on to add to your tool chest is called "Dust-Me Selectors."
http://www.sitepoint.com/dustmeselectors/
"It extracts all the selectors from all the stylesheets on the page you're viewing, then analyzes that page to see which of those selectors are not used. The data is then stored so that when testing subsequent pages, selectors can be crossed off the list as they're encountered.
You can test pages individually, or spider an entire site, and you'll end up with a profile of which selectors are not used anywhere."
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
www.alt-web.com/
www.twitter.com/altweb
www.alt-web.blogspot.com -
How to know the Z tcodes being used by the company.
Hi Everyone,
Can you please tell me how do i know what are the Z tcodes being used by the company.My client is asking me to check all the Ztodes & tell them if there is any problem in them or not.
Regards,
ReahHello
You can find transaction code list in table TSTC.
All Z transaction code start with character Y or Z, you can query above table to get list of Z transaction codes.
Additionally you can use transaction code SE93 to view list of transaction Z transaction code and reports associated with these tcodes.
For second question you should get adequate knowledge transfer from existing IT or developer who developed these reports to be able to understand and test functionality of z tcodes.
Or
Please refer functional and technical documentation of these Z tcodes or reports.
Thanks!
Raju -
CPU being used on the LIVE database server
Hi,
I'm seeing a lot of CPU being used on the LIVE database server, primarily by sessions running the following SQL :- As this is for audit log and a developer wrote it how can i optimize it or advise me pls
select * from ( select this_.ID as ID22_0_, this_.EVENT_TIME as EVENT2_22_0_, this_.AUDIT_LOG_EVENT_ID as AUDIT3_22_0_, this_.USER_ID as USER4_22_0_, this_.PUBLIC_OBJECT_ID as PUBLIC5_22_0_, this_.DESCRIPTION as DESCRIPT6_22_0_ from AUDIT_LOG this_ where this_.PUBLIC_OBJECT_ID=:1 order by this_.ID desc ) where rownum <= :2
thanksIt's a Top-N query and can be better written this way:
select this_.ID as ID22_0_, this_.EVENT_TIME as EVENT2_22_0_,
this_.AUDIT_LOG_EVENT_ID as AUDIT3_22_0_,
this_.USER_ID as USER4_22_0_, this_.PUBLIC_OBJECT_ID as PUBLIC5_22_0_,
this_.DESCRIPTION as DESCRIPT6_22_0_
from (select AUDIT_LOG.*, row_number() over (Order by ID desc) rn
from AUDIT_LOG
where PUBLIC_OBJECT_ID=:1 ) this_
where rn <= :2I don't know if it will solve your issue...there are so many other variables...
Max
http://oracleitalia.wordpress.com -
How to know the full path which is being used in the dataconnection .
How to know the full path which is being used in the dataconnection without going and looking into coding.
I am new to crystal reports.
Plz advice.Thanks in advance
JayThis forum is dedicated to topics related to custom application development or deployment with Crystal Reports in .Net. This includes full versions of Crystal Reports as well as those versions of Crystal Reports bundled with Microsoft Visual Studio .Net.
As you do not want to do any coding, this query is in the wrong forum. However, in most versions of Crystal Reports, you can look up the database connection information by simply opening the report in the CR designer. Then go to the database menu and select "Set Datasource Location..."
Ludek -
My old Apple ID is being used for the iCloud account on my phone. I cannot change the account when I click on iCloud Settings. Please help!!
You will have to sign out from the iCloud preference pane and sign in with the new ID. Of course when you sign out all your iCloud data - email, calendars, contacts - will disappear from your Mac, assuming you have indeed been syncing them to the iCloud account you want to stop using. You can transfer the calendars and contacts manually, but you can't move the email addresses from one iCloud account to another.
-
Can i revert back to the ios 5 maps on my pad. Im not quite satisfied with the maps being used on the ios 6 especially the street/ regular map. It looks good but some details like gas station, restaurants, sidestreets which are good references when travelling are not there anymore.
Load this map and save it on your Home Screen
https://maps.google.com/ -
Partial insert with secondary index
I'd like to use partial inserts (DB_DBT_PARTIAL).
However, I also need secondary indexes. Now when I insert partial data, the secondary index function is immediately called, but still I do not have enough data to calculate the secondary key. I tried to supply some app_data do the DBT, but it does not reach the secondary index function.
Is there any way I can use partial inserts together with secondary indexes?When writing a partial record to the primary database, here's what we do:
1. Look up the existing record via get()
2. Using the existing record and the partial DBT, construct the new record
3. Pass that newly constructed record to the secondary key generation function
You don't need to do anything special, your callback will receive the full record, even though you passed us a partial DBT. If that's not the case, there's a bug in BDB and we'd need to see your code.
app_data is a private field, you should not try to use it or expect it to work predictably. In this situation, we're passing a brand new DBT to the callback function, not the DBT you gave us. That's why app_data is empty.
Thanks,
Bogdan Coman -
Using a byte[] as a secondary index's key within the Collection's API
I am using JE 4.1.7 and its Collections API. Overall I am very satisfied with the ease of using JE within our applications. (I need to know more about maintenance, however!) My problem is that I wanted a secondary index with a byte[] key. The key contains the 16 bytes of an MD5 hash. However, while the code compiles without error when it runs JE tell me
Exception in thread "main" java.lang.IllegalArgumentException: ONE_TO_ONE and MANY_TO_ONE keys must not have an array or Collection type: example.MyRecord.hash
See test code below. I read the docs again and found that the only "complex" formats that are acceptable are String and BigInteger. For now I am using String instead of byte[] but I would much rather use the smaller byte[]. Is it possible to trick JE into using the byte[]? (Which we know it is using internally.)
-- Andrew
package example;
import com.sleepycat.je.Environment;
import com.sleepycat.je.EnvironmentConfig;
import com.sleepycat.persist.EntityStore;
import com.sleepycat.persist.PrimaryIndex;
import com.sleepycat.persist.SecondaryIndex;
import com.sleepycat.persist.StoreConfig;
import com.sleepycat.persist.model.Entity;
import com.sleepycat.persist.model.PrimaryKey;
import com.sleepycat.persist.model.Relationship;
import com.sleepycat.persist.model.SecondaryKey;
import java.io.File;
@Entity
public class MyRecord {
@PrimaryKey
private long id;
@SecondaryKey(relate = Relationship.ONE_TO_ONE, name = "byHash")
private byte[] hash;
public static MyRecord create(long id, byte[] hash) {
MyRecord r = new MyRecord();
r.id = id;
r.hash = hash;
return r;
public long getId() {
return id;
public byte[] getHash() {
return hash;
public static void main( String[] args ) throws Exception {
File directory = new File( args[0] );
EnvironmentConfig environmentConfig = new EnvironmentConfig();
environmentConfig.setTransactional(false);
environmentConfig.setAllowCreate(true);
environmentConfig.setReadOnly(false);
StoreConfig storeConfig = new StoreConfig();
storeConfig.setTransactional(false);
storeConfig.setAllowCreate(true);
storeConfig.setReadOnly(false);
Environment environment = new Environment(directory, environmentConfig);
EntityStore myRecordEntityStore = new EntityStore(environment, "my-record", storeConfig);
PrimaryIndex<Long, MyRecord> idToMyRecordIndex = myRecordEntityStore.getPrimaryIndex(Long.class, MyRecord.class);
SecondaryIndex<byte[], Long, MyRecord> hashToMyRecordIndex = myRecordEntityStore.getSecondaryIndex(idToMyRecordIndex, byte[].class, "byHash");
// ENDWe have highly variable length data that we wish to use as keys. To avoid massive index sizes and slow key lookup we are using MD5 hashes (or something more collision resistant should we need it). (Note that I am making assumptions about key size and its relation to index size that may well inaccurate.)Thanks for explaining, that makes sense.
It would be the whole field. (I did consider using my own key data design using the @Persistent and @KeyField annotations to place the MD5 hash into two longs. I abandoned that effort because I assumed (again) that lookup with a custom key design would slower than the built-in String key implementation.)A composite key class with several long or int fields will not be slower than a single String field, and will probably result in a smaller key since the UTF-8 encoding is avoided. Since the byte array is fixed size (I didn't realize that earlier), this is the best approach.
--mark -
Will indexes be used on the both sides of the join?
SELECT * FROM emp a, dept b WHERE a.dept_no = b.dept_no
Assume we have bitmap index on emp (dept_no) and we have binary index on dept (dept_no), will both the indexes be used for searching when equated?Prasath N wrote:
I had looked the Explain plan, but it is taking only one index (index on dept (deptno)).
I tried giving hint for the other index, still no change in explain plan.
Will the other index be used while joining and not shown in explain plan?Care to show us your test case?
And your Oracle version?
Here's mine....
create table my_emp as
select *
from scott.emp
create table my_dept as
select *
from scott.dept
create index my_dept_i01 on my_dept(deptno);
create bitmap index my_emp_i01 on my_emp(deptno);
explain plan for
SELECT b.deptno
FROM my_emp a, my_dept b
4 WHERE a.deptno = b.deptno;
Explained.
Elapsed: 00:00:00.01
TUBBY_TUBBZ?
TUBBY_TUBBZ?select * from table(dbms_xplan.display(NULL, NULL, 'ALL'));
PLAN_TABLE_OUTPUT
Plan hash value: 697535001
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 14 | 364 | 1 (0)| 00:00:01 |
| 1 | NESTED LOOPS | | 14 | 364 | 1 (0)| 00:00:01 |
| 2 | BITMAP CONVERSION TO ROWIDS | | 14 | 182 | 1 (0)| 00:00:01 |
| 3 | BITMAP INDEX FAST FULL SCAN| MY_EMP_I01 | | | | |
|* 4 | INDEX RANGE SCAN | MY_DEPT_I01 | 1 | 13 | 0 (0)| 00:00:01 |
Query Block Name / Object Alias (identified by operation id):
1 - SEL$1
2 - SEL$1 / A@SEL$1
4 - SEL$1 / B@SEL$1
Predicate Information (identified by operation id):
4 - access("A"."DEPTNO"="B"."DEPTNO")
Column Projection Information (identified by operation id):
1 - (#keys=0) "B"."DEPTNO"[NUMBER,22]
2 - "A".ROWID[ROWID,10], "A"."DEPTNO"[NUMBER,22]
3 - STRDEF[BM VAR, 10], STRDEF[BM VAR, 10], STRDEF[BM VAR, 7920],
"A"."DEPTNO"[NUMBER,22]
4 - "B"."DEPTNO"[NUMBER,22]
Note
- dynamic sampling used for this statement (level=2)
36 rows selected.
Elapsed: 00:00:00.02
TUBBY_TUBBZ?
TUBBY_TUBBZ?select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
5 rows selected.
Elapsed: 00:00:00.01Edited by: Tubby on May 28, 2010 9:20 AM
Added test case. -
Change the Table being used insight the Procedure
Dear All,
I had 1 table "Customer" which is being used in 100 store procedures.
Now I rename that table to "Customer_Q".
Is there any method in SQL to repoint that table name insight All procs, without open my procedures?
If not, pls suggest any smart way..Can you please throw some more light into it !!
Another way is this which will do replace behind the scene
DECLARE @Script varchar(max) = ''
SELECT @script = @script + REPLACE(definition,'CREATE PROC','ALTER PROC') + CHAR(13) + CHAR(10) + ' GO ' + CHAR(13) + CHAR(10)
FROM sys.sql_modules m
INNER JOIN sys.objects o
ON o.object_id = m.object_id
AND o.type = 'P'
WHERE definition like '% TableName %'
--double check script before execution
SELECT @script
--once happy uncomment below line and run full script again
--EXEC (@Script)
see this for more details
http://visakhm.blogspot.in/2012/03/advantages-of-using-syssqlmodules-view.html
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
Maybe you are looking for
-
Error while executing report RSSDBCHECKDBMRFC in se38 in sap for sap MaxDB
Hello experts, Let me tell you i do not have more knowledge on SAP MaxDB, I am getting some back up issue .When i checked the report RSSDBCHECKDBMRFC in se38 i got following error. ERROR: D:\sapdb\programs\pgm was not found ERROR: Set the following
-
Itunes sync to iphone 4 usage bar shows other 17GB can't delete
Trying to sync itunes to iphone 4 usage bar at bottom shows other 17gb can't delete this is taking more than half my space
-
Oracle.xml.sql.query.OracleXMLQuery not found
Hi! Sorry, but I got a project to continue and there is an import statement "import oracle.xml.sql.query.OracleXMLQuery;" and this gives me a compilation error... What do I need to do, where do I find this class??? Any help? //Patricia
-
Shell command execution from HTMLDB
I created a Java procedure for host calls on Unix environment, it seems to be working under sqlplus, the commands like "rc('/bin/mkdir /tmp/linkin);" works fine if used from within sqlplus but when executed from within html_db no directory is created
-
Credit Management Payment Termwise
Dear All, The problem is related to credit management which is explained below by an example - A party code 2000 has a credit limit of Rs. 100000/- and the payment term assigned to the customer is PM21 in which the amount becomes overdue after 21 day