dbTalk Databases Forums  

function-based index for SUM(field) and GROUP BY

comp.databases.oracle.server comp.databases.oracle.server


Discuss function-based index for SUM(field) and GROUP BY in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
porschberg
 
Posts: n/a

Default function-based index for SUM(field) and GROUP BY - 06-26-2003 , 07:07 AM






I have a SQL-Statement which looks like:
SELECT A, B, SUM(C), SUM(D)
FROM MYTABLE
GROUP BY A, B
Is it possible to enhance the performance by creating a
function-based index say

CREATE INDEX BLA ON MYTABLE
(SUM(C),SUM(D) GROUP BY A, B)
TABLESPACE IND ...

curious Thomas

Reply With Quote
  #2  
Old   
Noons
 
Posts: n/a

Default Re: function-based index for SUM(field) and GROUP BY - 06-26-2003 , 07:42 AM






No, but a materialized view comes to mind...

--
Cheers
Nuno Souto
wizofoz2k (AT) yahoo (DOT) com.au.nospam
"porschberg" <thomas.porschberg (AT) osp-dd (DOT) de> wrote

Quote:
I have a SQL-Statement which looks like:
SELECT A, B, SUM(C), SUM(D)
FROM MYTABLE
GROUP BY A, B
Is it possible to enhance the performance by creating a
function-based index say

CREATE INDEX BLA ON MYTABLE
(SUM(C),SUM(D) GROUP BY A, B)
TABLESPACE IND ...

curious Thomas



Reply With Quote
  #3  
Old   
Brian Peasland
 
Posts: n/a

Default Re: function-based index for SUM(field) and GROUP BY - 06-26-2003 , 08:15 AM



Since you don't have any predicates in the WHERE clause, a FBI will not
help you. Your best bet is probably Nuno's suggestion of a MV.

HTH,
Brian

porschberg wrote:
Quote:
I have a SQL-Statement which looks like:
SELECT A, B, SUM(C), SUM(D)
FROM MYTABLE
GROUP BY A, B
Is it possible to enhance the performance by creating a
function-based index say

CREATE INDEX BLA ON MYTABLE
(SUM(C),SUM(D) GROUP BY A, B)
TABLESPACE IND ...

curious Thomas
--
================================================== =================

Brian Peasland
oracle_dba (AT) remove_spam (DOT) peasland.com

Remove the "remove_spam." from the email address to email me.


"I can give it to you cheap, quick, and good. Now pick two out of
the three"


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.