Re: group by clause filling up temp space



ewong wrote:
Here is the explain plan.  I've tried 0=1 it doesn't help.  And yeah
this is the only query that fills up temp.  Thanks.

Execution Plan
----------------------------------------------------------
   0      SELECT STATEMENT Optimizer=CHOOSE (Cost=3162293791 Card=1847
          2014 Bytes=664992504)

   1    0   SORT (GROUP BY) (Cost=3162293791 Card=18472014 Bytes=66499
          2504)

   2    1     HASH JOIN (Cost=2480 Card=193301902913 Bytes=69588685048
          68)

   3    2       TABLE ACCESS (FULL) OF 'TABLEA' (Cost=727 Card=2
          48875 Bytes=7964000)

   4    2       TABLE ACCESS (FULL) OF 'TABLEB' (Cost=644
           Card=77
9648 Bytes=3118592)

Cost 3162293791? Ouch.

Look at www.psoug.org
click on Morgan's Library
click on GROUP BY

I have one or two alternatives to using the GROUP BY
clause that might help.

Why no indexes with what look to be your primary key columns: sid?
Or are they there and you are still getting FTE?
--
Daniel A. Morgan
http://www.psoug.org
damorgan@xxxxxxxxxxxxxxxx
(replace x with u to respond)
.



Relevant Pages

  • Re: group by clause filling up temp space
    ... this is the only query that fills up temp. ... Execution Plan ... Prev by Date: ...
    (comp.databases.oracle.server)
  • Re: Informix vs Oracle vs DB2. SQL Query optimization.
    ... but I think you're confused because you don't know Oracle. ... the query chooses to limit TAB_A by the col_id. ... initially we have the collection as geo1. ... case of 270,000 rows in the collection, and 60,000 rows in the temp ...
    (comp.databases.informix)
  • Re: Relationships, back end
    ... query the same, using the linked file directly rather than a temp table. ... |> into tblMovements but into a temp table, ... | adds the EquipmentID field the the temp table". ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Multi column update
    ... The example I've given is a sort of simplified version of my query, ... limited by how fast the server is able to write the redo information. ... temp table, and then reference that temp table with your update query: ... will be written to the trace file. ...
    (comp.databases.oracle.misc)
  • Re: Views
    ... discarded by examining the query plan. ... Thank you for using the Microsoft MSDN Managed Newsgroup. ... Based on the above the execution plan of the view query should be as same ... Microsoft Online Community Support ...
    (microsoft.public.sqlserver.clients)