Does GROUP BY force oracle go for sorting?
Version : 10.2
I usually rewrite all queries with DISTINCT clause to GROUP BY to avoid sorting in the temporary tablespace. But, doesn't GROUP BY queries go for sorting?
Hi,
I am on 10.2.0.1
SQL> alter system flush shared_pool;
System altered.
SQL> alter system flush buffer_cache;
System altered.
SQL> select deptno from emp group by deptno;
DEPTNO
30
20
10
Execution Plan
Plan hash value: 4067220884
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 3 | 9 | 4 (25)| 00:00:01 |
| 1 | HASH GROUP BY | | 3 | 9 | 4 (25)| 00:00:01 |
| 2 | TABLE ACCESS FULL| EMP | 14 | 42 | 3 (0)| 00:00:01 |
Statistics
335 recursive calls
0 db block gets
64 consistent gets
21 physical reads
0 redo size
456 bytes sent via SQL*Net to client
381 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
5 sorts (memory)
0 sorts (disk)
3 rows processed
SQL> alter system flush shared_pool;
System altered.
SQL> alter system flush buffer_cache;
System altered.
SQL> select distinct deptno from emp;
DEPTNO
30
20
10
Execution Plan
Plan hash value: 3709190377
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 3 | 9 | 4 (25)| 00:00:01 |
| 1 | HASH UNIQUE | | 3 | 9 | 4 (25)| 00:00:01 |
| 2 | TABLE ACCESS FULL| EMP | 14 | 42 | 3 (0)| 00:00:01 |
Statistics
754 recursive calls
0 db block gets
145 consistent gets
31 physical reads
0 redo size
456 bytes sent via SQL*Net to client
381 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
17 sorts (memory)
0 sorts (disk)
3 rows processedhmm,group by does sort but distinct seems to be more expensive w.r.t sorting.
Similar Messages
-
Designerd does not generate Order BY code for Sort Order on a lookup tabel column.
I am setting the Sort Order on a column which is based on a lookup table.
When generate the the module, designer does not generate the code for the Sort Order that I set on the lookup table column.
Is there a work around for this problem or is there some thing else that needs to be done in designer to make it generate the order by clause?
I will very much appreciate help.
Regards
Prasad.A bound lookup item, will be generated as a NON-database item in Forms. Designer generates an ORDER BY CLAUSE (a Forms Block property) for the ordering. But a NON-database item cannot be included in the ORDER BY CLAUSE.
I used a stored function for ordering the lookup item.
Best regards
Harm van Zoest -
Does anyone know when Oracle 9i for Windows NT is going to be released?
E-mail : [email protected]
nullI think Oracle 9i lite available with limited features.
null -
Oracle Lite for Windows CE H/PC
I have one question about Oracle Lite for Windows CE on Handheld/PC.
Which version of Oracle Lite for Windows CE supports Java stored procedures and
triggers and the Oracle Lite JAC and JDBC interfaces on H/PC? I have version 3.6 and 4.0.1 but this versions don't support
JAC, JDBC interfaces, Java stored procedures and triggers ( this is written in documentation ).
I urgently need version of Oracle Lite for Windows CE on H/PC which
mostly supports JDBC interface because I've developed an application for
Oracle Lite in JDeveloper with
JDBC interface and I intend to transfer this application on H/PC ( Velo
Phillips ) with Widows CE 2.0 operating system.
Does such version of Oracle Lite for Windows CE which supports JDBC
interface exist at all?
Please help me.
Thank you in advance.
nullThis is a forum for Forms questions. You should ask your question on one of the database forums.
Regards,
Robin Zimmermann
Forms Product Management -
Oracle 11g - Memory used for sorting
Hi everyone,
I would like to know how I could analyze memory used for sorting in Oracle 11g. When I run the below query, it returns 1531381.
select value from v$sysstat where name like 'sorts (memory)';But when I check sort_area_size parameter from v$parameter, it returns 65536. Does it mean my database is using more memory for sorting than sort_area_size. Or is the way I interpret v$sysstat view and sort_area_size wrong? What is the best way to monitor the memory usage for sorting? Thanks in advance.
Regards,
K.H
Edited by: K Hein on Apr 5, 2012 8:16 PMcheck the valuse of pga_aggregate_target
http://docs.oracle.com/cd/B19306_01/server.102/b14237/initparams157.htm
Note:
Oracle does not recommend using the SORT_AREA_SIZE parameter unless the instance is configured with the shared server option. Oracle recommends that you enable automatic sizing of SQL working areas by setting PGA_AGGREGATE_TARGET instead. SORT_AREA_SIZE is retained for backward compatibility.
What is the best way to monitor the memory usage for sorting? try v$sort_usage
or v$tempseg_usage
col sid_serial for a44
col size for a22
col SID_SERIAL for a22
SELECT b.tablespace,
ROUND(((b.blocks*p.value)/1024/1024),2)||' MB' "SIZE",
a.sid||','||a.serial# SID_SERIAL,
a.username,a.osuser,
a.program
FROM sys.v_$session a,
sys.v_$sort_usage b,
sys.v_$parameter p
WHERE p.name = 'db_block_size'
AND a.saddr = b.session_addr
ORDER BY b.blocks; -
Does Oracle 8i for Linux include Oracle Enterprise Manager?
What's the version of the current Oracle 8i for Linux?
Enterprise Edition?
nullHi,
Michael (guest) wrote:
: The latest OEM is in Java. It is included in o8i for Solaris,
: which I use for an o8i machine at work. They don't seem to
: include it with the Linux version, though, despite the fact
that
: it's Java and theoretically (the key word here...) it should be
: platform-independent and run on Linux just the same.
NO, it will not work. You cannot even install since the installer
for Solaris is a Solaris binary and some windows exe also does
not work. I guess somebody has to write a better bootstrap proggy
first...
I wonder why they did it that way...
Marcus
: Bryan Batchelder (guest) wrote:
: : Oracle8i for Linux is Oracle 8.1.5.0 Enterprise Edition.
: : As for Oracle Enterprise Manager, they still only have that
for
: : NT, but you can download it from OTN.
: : --Bryan
: : Gary Young (guest) wrote:
: : : What's the version of the current Oracle 8i for Linux?
: : : Enterprise Edition?
null -
Does replication group have to be set for session replication
I have delployed an servlet based application on a 3 node cluster. I have a simple POJO that I use to carry data in the session from a "confirm?" to "confirmed" page. This object implements serializable and only has String and int members. I put it in session using request.getSession().setAttribute("dto", myobject). For some reason it is not being replicated to the other nodes in the cluster. My weblogic.xml has "PersistentStoreType" set to "replicated_if_clustered". I am not seeing any serialization or other errors in the node logs.
I have looked at information contained in the link below and I think we are doing everything right. http://support.bea.com/application_content/product_portlets/support_patterns/wls/HTTP_Session_Replication_Failures_Pattern.html
The only thing that I noticed is that the "Replication Group" is not set for any of the servers in the cluster. Does this need to be set for replication to happen?Hi,
Having replication group is optional. It is used only if you are implementing failover in cluster. For session replication one has to generally configure 3 things:
- in memory replication
- jdbc replication
- file sytem replication
for im memory replication,
Step 1:
make sure taht a client is accesing the cluseter using either
- load balancing hardware
- web servers with weblogic proxy plugin
Step 2:
specify the persistance type in weblogic.xml
Thanks,
Sushma -
Where does one find the Oracle Best Practice/recommendations for how to DR
What is the Oracle Best Practice for install/deployment and configuration of ODI 11g for Disaster Recovery?
We have a project that is using Oracle ODI 11g (11.1.1.5).
We have configured all the other Oracle FMW components as per the Oracle DR EDG guides. Basically using the Host ip name/aliasing concept to ‘trick’ the secondary site into thinking
it is primary and continue working with minimal (or no) manual reconfiguration. But will this work for ODI? The FMW DR guide has sections for SOA, WebCenter and IdM, but nothing for ODI.
Since ODI stores so much configuration information in the Master Repository..when this DB gets ‘data guarded’ to the secondary site and promoted to Primary…ODI will still think it is at the ‘other’ site. Will this break the actual agents running the scenarios?
Where does one find the Oracle Best Practice/recommendations for how to DR ODI properly?
We are looking for a solution that will allow a graceful switchover/failover with minimal manual re-configuration.user8804554 wrote:
Hi all,
I m currently testing external components with Windows Server and I want to test Oracle 11g R2.
The only resource I have is this website and the only binaries seem to be for Linux OS.You have one other HUGE resource that, while it won't answer your current question, you'd better start getting familiar with if you are going to use Oracle. That is the complete and official documentation, found at tahiti.oracle.com
>
Does anybody know how I can upgrade my Oracle 11.1.0.7 version to the R2 release?
Thanks,
Bertrand -
Oracle Services for MTS on multiple servers - does not work
I am having problems with running transactional component (COM+) using Oracle Services for MTS.
I've been through pretty much all the messages in this forum, and I believe that I have
configured things correctly. Here are the details. Sorry for the long post. I wanted to give as much details as possible.
Database - Oracle 8i (8.1.7)
Machine I
1. Has Oracle Client 8.1.7 with 8.1.7.4.1 Patch set
2. Installed OraOLEDB version 8.1.7.3 and OraMTS
3. Configured Oracle MTS Service with MTSSYS against the database.
4. MSDTC is up and running
5. Transactional components registered properly in COM+.
6. Contains MDAC 2.6 SP1
7. Followed Microsoft Documentation (Using Oracle with MTS/COM+) to incorporate registry fixes
for MTXOCI - set OracleOciLib = oci.dll
OracleSQLLib = orasql8.dll
OracleXALib = oraclient8.dll
Machine II
1. Has Oracle Client 8.1.7 with 8.1.7.4.1 Patch set
2. Installed OraOLEDB version 8.1.7.3 and OraMTS
3. MSDTC is up and running
4. Transactional components registered properly in COM+.
5. Contains MDAC 2.6 SP1
6. Followed Microsoft Documentation (Using Oracle with MTS/COM+) to incorporate registry fixes
for MTXOCI - set OracleOciLib = oci.dll
OracleSQLLib = orasql8.dll
OracleXALib = oraclient8.dll
I have verified the database MTS_PROXY_INFO and the information seems to point to Machine I properly.
When I run the application on Machine I, things work OK, the component executes and performs its job
(just doing a transactional insert into a table is all). I try the same application on Machine II
and the application hangs and it waits forever in IDBInitialize->Initialize method, probably when trying to join a transaction. Here is a trace snippet
TID: eac (ENTRY) COracleSource::GetPropertyInfo(1, 0xb4f280, 0xb4f2e0, 0xb4f2e4, 0xb4f2d4)
TID: eac (EXIT) COracleSource::GetPropertyInfo(hr=0): 4240
TID: eac (ENTRY) IDBPropertiesImpl::GetProperties(1, 0x1cf1a70, 0xb4f2cc, 0xb4f2c8)
TID: eac (ENTRY) COracleSource::GetProperties(1, 0x1cf1a70, 0xb4f2cc, 0xb4f2c8)
TID: eac (EXIT) COracleSource::GetProperties(hr=0): 4107
TID: eac (EXIT) IDBPropertiesImpl::GetProperties(hr=0): 112
TID: eac (ENTRY) COracleSource::SetProperties(1, 0xa5630)
TID: eac (EXIT) COracleSource::SetProperties(hr=0): 4349
TID: eac (ENTRY) COracleSource::SetProperties(1, 0xb4f148)
TID: eac (EXIT) COracleSource::SetProperties(hr=0): 4349
TID: eac (ENTRY) COracleSource::Initialize()
TID: eac (EXIT) COracleSource::Initialize(hr=0): 231
TID: eac (ENTRY) IDBPropertiesImpl::GetProperties(1, 0xb4f0d0, 0xb4f0e8, 0xb4f0f0)
TID: eac (ENTRY) COracleSource::GetProperties(1, 0xb4f0d0, 0xb4f0e8, 0xb4f0f0)
TID: eac (EXIT) COracleSource::GetProperties(hr=0): 4107
TID: eac (EXIT) IDBPropertiesImpl::GetProperties(hr=0): 112
TID: eac (ENTRY) COracleSource::CreateSession(0x1cf32dc, 0x0, 0x0)
TID: eac (DTXN) COracleSession::FOraInit() - Session (194250c) created
TID: eac (EXIT) COracleSource::CreateSession(hr=0): 165
TID: eac (ENTRY) COracleSession::JoinTransaction(2030104, -1, 0, 0)
TID: eac (EXIT) COracleSession::JoinTransaction(hr=8004d00a): 139
I would appreciate any help in this matter. I need to get this running to go live.Hi.
I have the same problem, one which works and another which don't (almost though).
I got most of it to work by taking the mtsservices registry entry from the server that works and put it on to the other after i have made the service in Oracle management console for mts.
Now i can search, delete, change but not make a new entry into the database.
And thats where i'm stuck now.
Hope it helps a bit..
Michael
Greenland -
Oracle Services for MTS in multiple servers - does not work
I am having problems with running transactional component (COM+) using Oracle Services for MTS.
I've been through pretty much all the messages in this forum, and I believe that I have
configured things correctly. Here are the details. Sorry for the long post. I wanted to give as much details as possible.
Database - Oracle 8i (8.1.7)
Machine I
1. Has Oracle Client 8.1.7 with 8.1.7.4.1 Patch set
2. Installed OraOLEDB version 8.1.7.3 and OraMTS
3. Configured Oracle MTS Service with MTSSYS against the database.
4. MSDTC is up and running
5. Transactional components registered properly in COM+.
6. Contains MDAC 2.6 SP1
7. Followed Microsoft Documentation (Using Oracle with MTS/COM+) to incorporate registry fixes
for MTXOCI - set OracleOciLib = oci.dll
OracleSQLLib = orasql8.dll
OracleXALib = oraclient8.dll
Machine II
1. Has Oracle Client 8.1.7 with 8.1.7.4.1 Patch set
2. Installed OraOLEDB version 8.1.7.3 and OraMTS
3. MSDTC is up and running
4. Transactional components registered properly in COM+.
5. Contains MDAC 2.6 SP1
6. Followed Microsoft Documentation (Using Oracle with MTS/COM+) to incorporate registry fixes
for MTXOCI - set OracleOciLib = oci.dll
OracleSQLLib = orasql8.dll
OracleXALib = oraclient8.dll
I have verified the database MTS_PROXY_INFO and the information seems to point to Machine I properly.
When I run the application on Machine I, things work OK, the component executes and performs its job
(just doing a transactional insert into a table is all). I try the same application on Machine II
and the application hangs and it waits forever in IDBInitialize->Initialize method, probably when trying to join a transaction. Here is a trace snippet
TID: eac (ENTRY) COracleSource::GetPropertyInfo(1, 0xb4f280, 0xb4f2e0, 0xb4f2e4, 0xb4f2d4)
TID: eac (EXIT) COracleSource::GetPropertyInfo(hr=0): 4240
TID: eac (ENTRY) IDBPropertiesImpl::GetProperties(1, 0x1cf1a70, 0xb4f2cc, 0xb4f2c8)
TID: eac (ENTRY) COracleSource::GetProperties(1, 0x1cf1a70, 0xb4f2cc, 0xb4f2c8)
TID: eac (EXIT) COracleSource::GetProperties(hr=0): 4107
TID: eac (EXIT) IDBPropertiesImpl::GetProperties(hr=0): 112
TID: eac (ENTRY) COracleSource::SetProperties(1, 0xa5630)
TID: eac (EXIT) COracleSource::SetProperties(hr=0): 4349
TID: eac (ENTRY) COracleSource::SetProperties(1, 0xb4f148)
TID: eac (EXIT) COracleSource::SetProperties(hr=0): 4349
TID: eac (ENTRY) COracleSource::Initialize()
TID: eac (EXIT) COracleSource::Initialize(hr=0): 231
TID: eac (ENTRY) IDBPropertiesImpl::GetProperties(1, 0xb4f0d0, 0xb4f0e8, 0xb4f0f0)
TID: eac (ENTRY) COracleSource::GetProperties(1, 0xb4f0d0, 0xb4f0e8, 0xb4f0f0)
TID: eac (EXIT) COracleSource::GetProperties(hr=0): 4107
TID: eac (EXIT) IDBPropertiesImpl::GetProperties(hr=0): 112
TID: eac (ENTRY) COracleSource::CreateSession(0x1cf32dc, 0x0, 0x0)
TID: eac (DTXN) COracleSession::FOraInit() - Session (194250c) created
TID: eac (EXIT) COracleSource::CreateSession(hr=0): 165
TID: eac (ENTRY) COracleSession::JoinTransaction(2030104, -1, 0, 0)
TID: eac (EXIT) COracleSession::JoinTransaction(hr=8004d00a): 139
I would appreciate any help in this matter. I need to get this running to go live.Ganesh,
From the trace provided, it appears that the OraOLEDB had problems loading the OraMTS.DLL appropriately. Can you check to see if the OraMTS.DLL is in your %ORACLE_HOME%\bin and your PATH is set with %ORACLE_HOME%\bin included?
Another possibility is that an older version of OraMTS.DLL resides in your
%ORACLE_HOME%\bin. If you invoke "dumpbin /exports oramts.dll" at the DOS command line, one exported function should be called "OraMTSSvcEnlistEx". If you don't see this, then that means you should try reinstalling OraMTS 8.1.7 again.
Hope that helps.
- nari -
I am at starbucks and when I try to download my free music on itunes, my password is always rejected, even when i am forced to create a new one!!! what am I doing wrong, who do I ask for help?
Due to recent security issues and identify theft (mostly due to phishing scams), the iTunes Store seems to be requiring more frequent verification of credit card information when a card is registered in your account, even if you have a balance from a prepaid card. Either just go through the verification process or, if you have a credit card entered and you don't expect to need the card anytime soon, go into the Payment information in your account and set the payment method to "none" which should then stop the regular requirements for verification (it may still ask - mine does - but you should just be able to click through the buttons without problems).
Hope this helps. -
Hello!
Staff of E4 Group JSC use Apple devices for call, reading email and calendars. When the user open event in calendar of iPhone or iPad, he does not see attachments (picture №1, picture №2). But it is possible on Blackberry (picture №3). How user of Apple can see these attachments? Recommend please any apps for it.Hello!
Staff of E4 Group JSC use Apple devices for call, reading email and calendars. When the user open event in calendar of iPhone or iPad, he does not see attachments (picture №1, picture №2). But it is possible on Blackberry (picture №3). How user of Apple can see these attachments? Recommend please any apps for it. -
DOES WORKFLOW 2.6 REQUIRE ORACLE ACCOUNTS FOR USERS?
We would like to integrate Oracle Workflow with our existing implementation of Oracle Portal. I was hoping that, by using OID accounts and groups, that SSO could be used to access whatever workflow functionality was required by our users WITHOUT also creating an Oracle account for each of these users.
IS THIS FEASIBLE?There might be some configuration required, but this should work. Workflow only requires the Oracle HTTP Server + ModPLSQL to render screens.
The Oracle Plug In for Microsoft IIS is available for Windows NT and Windows 2000.
To quote the Configuration Guide:
Oracle Plug-in for Microsoft IIS enables you to use Microsoft Internet Information Server (IIS), the Web server included with Windows NT, to directly access PL/SQL and Java Web components stored in the Oracle database server. This plug-in provides a fast and integrated method of accessing PL/SQL and Java Web components running in the IIS environment. Oracle Plug-in for Microsoft IIS provides functionality similar to Apache's PL/SQL Gateway (mod_plsql) and Apache's mod_ose in the IIS environment.
Link to http://otn.oracle.com/docs/products/ias/doc_library/1022doc_otn/index.htm for more information.
Hi,
My client is evaluating Oracle Workflow and would like to know if we could use IIS for the web side of the Workflow applications.
if not can Oralce 9ias be installed on the same server where IIS is currently installed.
Any help is much appreciated.
Many thanks
Nazeer Ahmad Syed. -
Oracle query for top two salary of each group departmentwise
oracle query for top two salary departmentwise
sigh...
But anyway,
Top-n queries:
http://www.oracle.com/technology/oramag/oracle/07-jan/o17asktom.html
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2853107469873
and ofcourse lots of 'em here on OTN... -
Howto force Oracle XML parser not to expand entity references?
Hi,
Is it possible to force Oracle XML parser (Java) not to expand entity references, so that they appear in DOM tree as separated nodes after parsing XML?
Example:
for following XML
<tag>abcäxyz</tag>
I get:
Element: "tag"
|-Text: "abcdxyz"
but I would like to get:
Element: "tag"
|-Text: "abc"
|
|-EntityReference: "auml"
|
|-Text: "xyz"
I've already tried to use JAXP api (setExpandEntityReferences method in java.xml.parsers.DocumentBuilderFactory), but it doesn't seem to work.
I'm using parser from XDK Java v9.2.0.2.0 Production.
Thx,
JamesThis is requested code sample:
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setExpandEntityReferences(false);
System.out.println("isExpandEntityReferences = "+dbf.isExpandEntityReferences());
DocumentBuilder db = dbf.newDocumentBuilder();
Document d = db.parse("file://c:/test.xml");
Element e = d.getDocumentElement();
System.out.println("documentElement"+ e.getTagName() + " nodeType=" +e.getNodeType());
System.out.println("ChildNodes:");
NodeList nodeList = e.getChildNodes();
for(int i=0; i<nodeList.getLength();i++) {
System.out.println(i+" value=\""+nodeList.item(i).getNodeValue()+"\" nodeType="+nodeList.item(i).getNodeType());
Content of test.xml:
<!DOCTYPE test SYSTEM "test.dtd">
<test>abcäxyz</test>
Content of test.dtd:
<!ELEMENT test (#PCDATA)>
<!ENTITY auml "ä">
When you run it you will get the following output:
isExpandEntityReferences = true
documentElementtest nodeType=1
ChildNodes:
0 value="abcdxyz" nodeType=3
which means that EntityReference has been expanded.
As you can see in the output the isExpandEntityReferences method returns "true", even though I set it to false in code!
Does it mean that Oracle parser simple doesn't support this feature???
Thx,
James
Maybe you are looking for
-
PCB-Layout 290x Gaming 4gb vs. 8gb
Hi, is there a big difference between these two Layouts? I want to put the 8gb under Water. Fit a 290x 4gb cooler on the 8gb version?
-
Friends, My pc card door is stuck open (no pc card inserted). How can I get it to return to the closed position? (eject button doesn't seem to work) Thanks. rcbarr
-
I've been switching between firefox and safari and with both browsers, they will just randomly freeze. I am still able to use other programs though. Any help? Thanks.
-
i wanna make a calendar on my iweb site. i wanted to add a calendar element to a page but also have an image above it to make it look like a real calendar u put on a wall. and i would change the image every month. so i would prefer to be able to put
-
E-mail notification when someone contributes to a discussion?
We are converting from Oracle Discoverer to BusinessObjects. We will be deploying InfoView to our users. One feature we think could be useful to our users is the discussion for a report. Currently, discussion about a report would be handled in our