If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Informix Distinct Vs Group By

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-25-10, 09:14
informixanto informixanto is offline
Registered User
 
Join Date: Jan 2010
Posts: 1
Informix Distinct Vs Group By

Hi All,

Distint or Group By which one is having better performance in informix database?

In my Select Query there is no aggregate function. Its direct select query with WHERE clause.
I am using Distinct method... But one of senior person told me, group by is having better performance than Distinct?
Is it true?
Please let me know in details or post any article url regarding this issue..
Thanks.
Antony
Reply With Quote
  #2 (permalink)  
Old 02-06-10, 15:16
Luis Santos Luis Santos is offline
Registered User
 
Join Date: Jun 2009
Location: Lisboa, Portugal
Posts: 50
Hi,

Distinct you use when you want only a single record. When you use group by you aggregate information you are querying database to obtain several results. I´m not a specialist in the way how Informix work inside doing their job, but for my experience there is no great deference in performance, because in distinct the server must obtain the results of the query and discard what is no longer necessary, in group by, joins must be made and must be returned to you as the same. I´ve tried both and i couldn't obtain great performance difference.

Luis.
Reply With Quote
  #3 (permalink)  
Old 02-12-10, 10:36
dav1mo dav1mo is offline
Registered User
 
Join Date: Dec 2007
Location: Richmond, VA
Posts: 779
Sometimes a group by can use an index to avoid a sort. If there is no suitable index to use, then you are no better off with one over the other.
Dave
Reply With Quote
Reply

Tags
informix distinct groupby

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On