How to check small table scan full table scan if we will use index in where clause.
How to check small table scan full table scan if i will use index column in where clause.
Is there example link there i can test small table scan full table if index is used in where clause.
Use explain plan on your statement or set autotrace traceonly in your SQL*Plus session followed by the SQL you are testing.
For example
SQL> set autotrace traceonly
SQL> select *
2 from XXX
3 where id='fga';
no rows selected
Execution Plan
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=13 Card=1 Bytes=16
5)
1 0 PARTITION RANGE (ALL) (Cost=13 Card=1 Bytes=165)
2 1 TABLE ACCESS (FULL) OF 'XXX' (TABLE) (Cost=13 Card
=1 Bytes=165)
Statistics
1 recursive calls
0 db block gets
1561 consistent gets
540 physical reads
0 redo size
1864 bytes sent via SQL*Net to client
333 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
0 rows processed
Similar Messages
-
How to check what is the full name of the installer is used?
Hi,
how to check what is the full name of the installer is used?
Thanks,Very nice, but assuming you did deliberately fire the installer, don't you remember the command? Apart from that your question has (as usual) no version and no platform and no context. If you are still in the installer and using any variant of Unix you can very easily run 'ps' to see the exact command.
You would have needed to provide platform and version information when submitting the SR. Can you explain why you have this forum guess at it?
Sybrand Bakker
Senior Oracle DBA -
How to check the tables we have created in JDBC??
I have created a table called COFFEE2 in a datasource called temp which is in SQL server...How to check the table values??
i went into administrative tools and odbc cource then i could see the data source i have created but how to see the table??
Can anyone help??
thanxHmm.. not sure that I understand the problem.
Call getConnection on the DataSource, and then execute the select query on the connection.
Kaj -
How to check with table for cursor..?
How to check with table for cursor..?
Here I have Table temp_final_plan
Here i want to update if already exit...below is the procedure....
CREATE OR REPLACE PROCEDURE spu_final_profit_plan
AS
-- Constant declarations
ln_errnum number := 0;
-- Variable declarations
ls_errmsg app_errors.err_msg%TYPE;
ls_appmsg app_errors.app_msg%TYPE;
ls_appid app_errors.app_id%TYPE;
-- Cursor declaration for final_update_el
CURSOR cur_final_update_el IS
select '910' ent,
'9127316' center,
post_acct,
sum(avg_mtd_01) sum_avg_mtd_01,
sum(avg_mtd_02) sum_avg_mtd_02,
sum(avg_ytd_01) sum_avg_ytd_01,
sum(avg_ytd_02) sum_avg_ytd_02
from mon_act_cypy
where rec_type = 'A'
and sum_flag = 'D'
and yr = '2008'
and substr(ctr_or_hier, 1, 2) = 'el'
and ent || sub_ent in
(select ent || sub_ent
from ent_ref
where roll_ent || roll_sub_ent = '999100')
group by post_acct
having sum(avg_mtd_01) <> 0
or sum(avg_mtd_02) <> 0
or sum(avg_ytd_01) <> 0
or sum(avg_ytd_02) <> 0;
-- Cursor declaration for final_update
CURSOR cur_final_update IS
select b.plan_ent b_plan_ent,
b.plan_ctr b_plan_ctr,
a.post_acct a_post_acct,
sum(a.avg_mtd_01) sum_avg_mtd_01,
sum(a.avg_mtd_02) sum_avg_mtd_02,
sum(a.avg_ytd_01) sum_ytd_mtd_01,
sum(a.avg_ytd_02) sum_ytd_mtd_02
from mon_act_cypy a,
plan_unit_tbl b
where a.ent || a.ctr_or_hier = b.ent || b.ctr_or_hier
and a.rec_type = 'A'
and a.sum_flag = 'D'
and a.yr = '2008'
and b.hier_tbl_num = '001'
and a.ent || a.sub_ent in
(select ent || sub_ent
from ent_ref
where roll_ent || roll_sub_ent = '999100')
group by b.plan_ent, b.plan_ctr, a.post_acct
having sum(a.avg_mtd_01) <> 0
or sum(a.avg_mtd_02) <> 0
or sum(a.avg_ytd_01) <> 0
or sum(a.avg_ytd_02) <> 0;
-- Begin the procedure body
BEGIN
-- Insert / Update final profit plan for final_update query using cursor
FOR rec_final_update_el IN cur_final_update_el
LOOP
EXIT WHEN rec_final_update_el%NOTFOUND;
IF rec_final_update_el. THEN
UPDATE temp_final_plan
SET sum_avg_mtd_01 = rec_final_update_el.sum_avg_mtd_01,
sum_avg_mtd_02 = rec_final_update_el.sum_avg_mtd_02,
sum_avg_ytd_01 = rec_final_update_el.sum_avg_ytd_01,
sum_avg_ytd_02 = rec_final_update_el.sum_avg_ytd_02,
WHERE ent = rec_final_update_el.ent
AND center = rec_final_update_el.center
AND post_acct = rec_final_update_el.post_acct;
ELSE
INSERT INTO temp_final_plan VALUES(rec_final_update_el.ent,
rec_final_update_el.center,
rec_final_update_el.post_acct,
rec_final_update_el.sum_avg_mtd_01,
rec_final_update_el.sum_avg_mtd_02,
rec_final_update_el.sum_avg_ytd_01,
rec_final_update_el.sum_avg_ytd_02);
END IF;
END LOOP;
-- Insert / Update final profit plan for final_update query using cursor
FOR rec_final_update IN cur_final_update
LOOP
EXIT WHEN rec_final_update%NOTFOUND;
IF rec_final_update. THEN
UPDATE temp_final_plan
SET sum_avg_mtd_01 = rec_final_update.sum_avg_mtd_01,
sum_avg_mtd_02 = rec_final_update.sum_avg_mtd_02,
sum_avg_ytd_01 = rec_final_update.sum_avg_ytd_01,
sum_avg_ytd_02 = rec_final_update.sum_avg_ytd_02,
WHERE ent = rec_final_update.b_plan_ent
AND center = rec_final_update.b_plan_ctr
AND post_acct = rec_final_update.a_post_acct;
ELSE
INSERT INTO temp_final_plan VALUES(rec_final_update.b_plan_ent,
rec_final_update.b_plan_ctr,
rec_final_update.a_post_acct,
rec_final_update.sum_avg_mtd_01,
rec_final_update.sum_avg_mtd_02,
rec_final_update.sum_avg_ytd_01,
rec_final_update.sum_avg_ytd_02);
END IF;
END LOOP;
-- EXCEPTION handling section
EXCEPTION
-- Fire OTHERS Exception case by default
WHEN OTHERS THEN
-- ROLL BACK Transaction, if any failure
ROLLBACK;
ln_errnum := SQLCODE;
ls_errmsg := SUBSTR(SQLERRM, 1, 100);
-- Log the ERRORS into APP_ERRORS table using SPU_LOG_ERRORS procedure
spu_log_errors(ln_errnum, ls_errmsg, ls_appid, ls_appmsg);
-- End of the stored procedure
END spu_final_profit_plan;
[\pre]I'm not sure what you mean by, 'How to check with table for cursor..?' but I'll offer a comment on your Code Snippet. I think you want to know how to check if a record exists so you know if you need to perform an INSERT or an UPDATE.
Here is a snippet of your code. I'll put my comments in "Comment" style in your code.
-- Insert / Update final profit plan for final_update query using cursor
FOR rec_final_update_el IN cur_final_update_el
LOOP
/* There is no need to test for %NOTFOUND since you are using Cursor FOR Loop!
** This construct automatically exits when the last record is processed. */
EXIT WHEN rec_final_update_el%NOTFOUND;
/* Is this where you would like to know how to Check if the record already exist??
** I asked this because, 'rec_final_update_el.' is not valid syntax. Are you looking for
** an Cursor Attribute or Method you can check here?
** I would suggest a Primary Key or Unique Index on ENT, CENTER, and POST_ACCT
** on the TEMP_FINAL_PLAN table. Then simply perform an INSERT and code an
** Exception to UPDATE when you get a DUP_VAL_ON_INDEX exception. Otherwise,
** you will need to simply run an Implicit or Explicit Cursor to test if the row exists and
** use this return value to determine if you should INSERT or UPDATE. */
IF rec_final_update_el. THEN
UPDATE temp_final_plan
SET sum_avg_mtd_01 = rec_final_update_el.sum_avg_mtd_01,
sum_avg_mtd_02 = rec_final_update_el.sum_avg_mtd_02,
sum_avg_ytd_01 = rec_final_update_el.sum_avg_ytd_01,
sum_avg_ytd_02 = rec_final_update_el.sum_avg_ytd_02,
WHERE ent = rec_final_update_el.ent
AND center = rec_final_update_el.center
AND post_acct = rec_final_update_el.post_acct;
ELSE
INSERT INTO temp_final_plan VALUES(rec_final_update_el.ent,
rec_final_update_el.center,
rec_final_update_el.post_acct,
rec_final_update_el.sum_avg_mtd_01,
rec_final_update_el.sum_avg_mtd_02,
rec_final_update_el.sum_avg_ytd_01,
rec_final_update_el.sum_avg_ytd_02);
END IF;
END LOOP;I hope I've answered your question, but if I haven't please provide more details so we can better understand your request.
Craig... -
Dear experts!
Thank you for your attention!
I have studied the SAP SD for half a year, though I still don't know how to check certain table like:
KNVS---customer master shipping data
KNBK---customer master (bank detail)
ADR---address table
ect.
could somebody help me?
Best regard!
TangdarkHi Tang,
SAP SD having lot of tables but i am telling main tables.
VBAK - Sales Document Headerdetailes
VBAP - Sales Document Itemdetailes
VBEK - Sales Document Scheduline data
LIKP - Delivery Header Detailes
LIPS - Deliver Item Detailes
VBRK - Billing Header Data.
VBRP - Billing Item Data.
VBFA - Sales Document Flow
VBUK - Sales document header status data
VBUP - Sales document item status data.......ctc.
Regards
Rajendra -
How to check PSA Table Structure ?
Hi Friends,
Can you pls any one tell me how to find out PSA Table and how to check PSA Table Structure? .Thanks in advance.
Regards,
CSHi Sri,
Goto RSA1 trans> select your DS> right clcik> Manage> you will get a Pop-up with all the PSA requests--> on the top Left you can see the PSA name(Technical name) in the form PSA/BIC/BXXXXXX
PSA & DS structue will be same. Goto RSO2 transaction> Enter your DS name> double click on the extract structure. It will take you to the Extract structure.
(Or) if you know the extract structure name, directly goto Se11 trans & enter the technical name of Extract structure & Display.
Take the screenshot & send it to your TL.
Regards,
Pavan -
How to check one table exist or not in SAP
Hi, Gurus:
How to check one table exist or not in the SAP.
Thanks,Hi,
Query the table DD02L..
Select single * from DD02L where tabname = 'Your table name'
AND TABCLASS = 'TRANSP'. " For transparent tables.
Thanks
Naren -
How to add multiple table when creating add on using b1de
Hi all,
Plz help me
How to add multiple table when creating add on using b1de.
ThanksHi dns_sap,
Can you explain a little better what you are trying to accomplish? Is it to create UserTables and UserFields in the database, when the addon runs the first time?
If so, you can use the following code
Add User Table
Try
Dim lRetCode As Long
Dim oUDT As SAPbobsCOM.UserTablesMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserTables)
oUDT.TableName = TableName
oUDT.TableDescription = TableDescription
oUDT.TableType = TableType
lRetCode = oUDT.Add
'// Check for error when adding the Table: if lRetCode = 0 the table was created; if lRetCode = -2035 the table already exisits
If lRetCode <> 0 Then
oApplication.MessageBox("Error: " & lRetCode.ToString & ", " & oCompany.GetLastErrorDescription)
End If
Catch ex As Exception
oApplication.MessageBox(oCompany.GetLastErrorDescription)
Finally
System.Runtime.InteropServices.Marshal.ReleaseComObject(oUDT)
oUDT = Nothing
lRetCode = Nothing
GC.Collect()
End Try
Add User Field
Try
Dim lRetCode As Long
Dim oUDF As SAPbobsCOM.UserFieldsMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)
oUDF.TableName = TableName
oUDF.Name = FieldName
oUDF.Description = FieldDescription
oUDF.Type = FieldType
lRetCode = oUDF.Add
'// Check for error when adding the field: if lRetCode = 0 the field was created; if lRetCode = -2035, the field already exists
If lRetCode <> 0 Then
oApplication.MessageBox("Error: " & oCompany.GetLastErrorCode & ", " & oCompany.GetLastErrorDescription)
End If
Catch ex As Exception
oApplication.MessageBox(oCompany.GetLastErrorDescription)
Finally
System.Runtime.InteropServices.Marshal.ReleaseComObject(oUDF)
oUDF = Nothing
lRetCode = Nothing
GC.Collect()
End Try
Regards,
Vítor Vieira -
How does one add tables to an existing universe using COM designer SDK.
Morning All
How does one add tables to an existing universe using COM designer SDK. I have tried:
objUniverse.Tables.Add (strTable_Name)
but get "Cannot create Table" error.
Any ideas?
Thanks in advance.
AnitaHi Anita,
-Use the Add method to add classes and objects to an existing universe using a VB 6 application.
Adding a Class
Definition: Function Add(Name As String) As Class
Syntax: NameOfClassesVariable.Add
Adding an Object Instance
Definition: Function Add(Name As String, [ClassName As String]) As Object
Syntax: NameOfObjectsVariable.Add(name, [class])
- name is the name of the object.
- class is the name of the class containing the object. This parameter should be used in cases where more than one objects exist with the same name.
Sample Visual Basic 6 Code
Dim DesApp As Designer.Application
'MODIFY AND EXPORT CLASSES AND OBJECTS OF AN EXISTING UNIVERSE
Sub modify_and_export_universe()
Dim DesUnv As Designer.Universe
Dim DesCls As Designer.Class
Dim DesObj As Designer.Object
Dim DesDBCol As Designer.DBColumn
Dim DBColName As String
Set DesApp = New Designer.Application
'Login to designer
Call DesApp.LogonDialog
'Make sure to log on with your administrator profile
'e.g : "hostname","username", "password","Enterprise"
'Make Designer application visible
DesApp.Visible = True
'This line disable warning messages from Designer
DesApp.Interactive = False
'to Open locally the universe you want to modify
'Set DesUnv = DesApp.Universes.Open("club_uni")
'Use OpenFromEnterprise method (Universes Class) to import a universe from the repository and opens it
Set DesUnv = DesApp.Universes.OpenFromEnterprise("Universes", "club_uni", False)
'Add a valid connection which already exists
DesUnv.Connection = "club"
'open the universe
'Call DesApp.Universes.Open("club_universe")
'Add the table Account and refresh the view in the main window
Set DesTab = DesUnv.DBTables.Item("Customer").Insert
DesUnv.ArrangeTables
'Add a class
Set DesCls = DesUnv.Classes.Add("Class MyCustomer")
'Looping through all the fields of the DB Table Account
For Each DesDBCol In DesUnv.DBTables.Item("Customer").DBColumns
'Store name of the column
DBColName = DesDBCol.Name
'Add an object to the class
Set DesObj = DesCls.Objects.Add("Obj " & DBColName)
'Affect a field to the object
DesObj.Select = "Customer" & "." & DBColName
Next
'Save the existing universe with the same name club_uni or you can change
DesUnv.SaveAs "club_uni"
MsgBox "Universe created and saved Class MyCustomer has been added!!"
'Close the universe
UnvFullName = DesUnv.FullName
MsgBox "The UniverseFilePath is " & UnvFullName
'Close the universe
DesUnv.Close
'This line disable warning messages from Designer
DesApp.Interactive = False
'Export the universe to the CMS DB (to the last universe folder)
'Make sure you save the universe before exporting it
Call DesApp.Universes.Export("Universes", UnvFullName)
MsgBox "This document has been exported successfully !!"
'Close designer
DesApp.Quit
Set DesApp = Nothing
End Sub
Hope this helps.
Regards,
Deepti Bajpai -
HI,
How to check the user hits to the sites (most often,frequently used sites) in sharepoint 2010?
could you please help on the above?Hello Sudhir muvva,
Just to be sure, the default Web Analytics reports don't meet your requirements?
http://blogs.msdn.com/b/ecm/archive/2010/03/21/introducing-web-analytics-in-sharepoint-2010.aspx
Does reports have subjects like top pages and number of page views.
- Dennis | Netherlands | Blog |
Twitter -
How to check whether a Document in KM is classified or not using JAVA API
Hello Everyone,
Can anyone tell me, How to check whether a Document in KM is classified or not, using JAVA API's??
Thanks & Regards,
Adren D'SouzaHi,
The code is as follows:
IIndexService indexService = null;
try {
indexService = (IIndexService) ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
} catch (ResourceException e) {
if (indexService == null) {
log.errorT("Error on instanciating the index service");
return this.renderMessage(this.getBundleString(RES_NO_INDEX_SERVICE), StatusType.ERROR);
// get index
IIndex index = null;
try {
index = indexService.getIndex("YourIndexID");
} catch (WcmException e1) {
log.errorT("Error when trying to get the index");
return this.renderMessage(this.getBundleString(RES_NO_INDEX), StatusType.ERROR);
// check if the index is a instance of AbstractClassificationIndex
AbstractClassificationIndex classiIndex = null;
if (index instanceof AbstractClassificationIndex) {
classiIndex = (AbstractClassificationIndex) index;
} else {
log.errorT("The index " + index.getIndexName() + " is no classification index");
return this.renderMessage(this.getBundleString(RES_NO_CLASSIFICATION_INDEX), StatusType.WARNING);
//give your KM Resource here for which you want to know if it is classified or not
boolean classified = classiIndex.isDocClassifiedInAnyTax(resource);
Regards,
Praveen Gudapati -
I have a mac pro for work and they made it log on windows at start up. how can i switch back to Mac as well so i will use the i cloud fetures ?
Is a version of Mac OS running on this Mac? Reboot and hold down the option key.
-
How to check if table or index bound to data cache loaded in memory?
In my system, thare are many named data caches created and certain objects bind to those data cache.
For example, I have a large table mytab which is bound to data cache mycache.
When I issue a sql like select * from mytab where x=y, run it at first time is is very slow. run it again and again. then it very fast. it means data loaded in cahce and ready for same query.
Question:
1. How can I know if the table mytab has been loaded in data cache mycache?
2. How to load mytab into data cahce mycache one time for all query in the feature?one way to monitor is:
select CacheName,DBName,OwnerName,ObjectName,IndexID,sum(CachedKB) as "CachedKb"
from master..monCachedObject
group by CacheName,DBName,OwnerName,ObjectName,IndexID
order by CacheName,DBName,OwnerName,ObjectName,IndexID
But, you should understand that caches have a finite size, and caches contain "pages" of objects including data pages, index pages, and LOB pages. Also, caches may have different pool sizes, so a page can be in only one cache pool. So, if you want a table and all of it's indexes, text/image pages to be loaded into a dedicated cache, you need a large enough cache to fit all of those pages, and decide which buffer pool you want them in (typically either the 1 page pool, or the 8 page pool).
Then, simply execute SQL (or dbcc) commands that access all of those pages in the manner you wish to find them in the cache. For example, two statements, one that scans the table using 2k reads, and another that scans the index (mytab_ind1) using 2k reads.
select count(*) from mytab plan '( i_scan mytab_cl mytab) ( prop mytab ( prefetch 2 ) ( lru ) )'
select count(*) from mytab plan '( i_scan mytab_ind1 mytab) ( prop mytab ( prefetch 2 ) ( lru ) )'
etc etc.
used count(*) to limit result sets of examples -
How to check which table is used
After creating RFQ , i want to check which table is used in creating RFQ.
how can i see that data has gone or not into the database table.Hi
See the Table EKKO and EKPO only
with EKKO-BSTYP = A
Regards
Anji -
How to check which table is using my table
Hi,
I have a table say Temp_Rd.
How do I check which table is using my table Temp_Rd??
Which table is using my Temp_Rd as the dependencies in the sql database?
Thank you very much.Oops, pardon me for asking the questions unclearly.
Its like some table Foreign Key is references to my this table Temp_Rd.
Eg,
CONSTRAINT "FK_SomeTable" FOREIGN KEY ("ID")
REFERENCES "Temp_Rd" ("ID")
How do I know which are the some table?
I hope I explain it better this time.
Sorrie about it.
Maybe you are looking for
-
Right side of a shuttle - Retunr id and not the display value of the LOV.
Hi all, The matter is how to populate/persist right-side of Shuttle in apex 4.0.1 after submit. The only problem I have is that the values on the right side of the shuttle are dispayed as (retun value of the LOV) and not as (dislay valueo of the LOV)
-
New Windows laptop recommendations for CS6
Hi, I need some recommendations on new laptop that can run Web and Design Premium CS6, and some places where I could purchase or get it custom made. I mainly use InDesign, Photshop, Illustrator, and some Dreamweaver. I like fast computers. I need a l
-
N73 Sports Tracker Still Does Not Work PLEASE FIX
I see people complained about this before /t5/Nseries-Devices-and-S60/Nokia-Sports-Tracker-Won-t-Start-N73/m-p/336675 That was in 2009 with older versions of Sports Tracker. Yesterday i installed the latest firmware from the Nokia website for the N73
-
Hello! I am unable to create a dataset (type dataset) for a report in Visual Studio 2012. My Type dataset is a Stored Procedure. This same report with same Proc was developed successfully using a report builder. What do I do to make it work using SSR
-
How to write if condition in Interactive reporting
Hi,<BR>Following function is existing in cognos<BR>if ( Calculation in the Report starts with M ) then ( 1 ) else ( months-between ( FolderItemRef[Prompts.Common.Dates.EffStartDt],FolderItemRef[Prompts.Common.Dates.EffEndDt] ) + 1 ) <BR><BR>I need to