for   
Save 
Save 
   Join IIUG  

Informix News
29 April 08 - IntelligentEnterprise.com - IBM Informix Upgrade Enhances Clustering, Database Management... Read
29 April 08 - itweek.com - IBM 'Cheetah 2' mauls data costs... Read
28 April 08 - eWeek.com - IBM Uncages Cheetah 2 Data Server... Read
28 April 08 - CNNMoney.com - IBM Helps Clients Reduce Data Management Costs With New Informix Dynamic Server... Read
09 April 08 - CNNMoney.com - MediaSpan Embeds IBM Informix Dynamic Server Software for Delivering News to Print, Web and Wireless Devices... Read
08 April 08 - IT-Director.com - Informix seeks developers... Read
18 February 08 - marketwire.com - Icarus Studios Partners With IBM to Upgrade Performance, Availability for Its Online Games... Read
17 January 08 - eWeek.com - IBM Adds Mac Support to IDS for Higher Education... Read
17 January 08 - informationweek.com - Lotus Notes For iPhone Signals Closer Ties Between IBM, Apple... Read
16 January 08 - marketwire.com - IBM Informix Dynamic Server to Deliver Support for Mac OS X... Read
16 January 08 - internetnews.com - IBM's IDS to Support Mac Platform... Read
28 June 07 - REG Developer - IBM and Informix tie down Cheetah... Read
27 June 07 - CBRonline.com - IBM corrects its own Informix customer figures... Read
14 June 07 - vnunet.com - IBM changes spots with Informix 'Cheetah' database... Read
14 June 07 - eChannelLine - IBM expands scope for IDS... Read
14 June 07 - Resellernews - IBM: Informix database alive and kicking... Read
13 June 07 - DB2 Magazine - Cheetah is now out of the gate... Read
12 June 07 - IBM - IDS 11 release announcement (pdf)... Read
12 June 07 - ChannelWeb Network - IBM Uncages IDS 11, Aka Cheetah, Database... Read
12 June 07 - eWeek.com - IBM's 'Cheetah' Ready to Pounce... Read
12 June 07 - InformationWeek - IBM Unleashes 'Cheetah' Database... Read
12 June 07 - WebWire - IBM Strengthens Database Portfolio With New Informix Dynamic Server... Read
12 June 07 - Intelligent Enterprise - IBM Unveils Informix Upgrade... Read
12 June 07 - ComputerWeekly.com - IBM's Cheetah IDS makes leap to better data centre clustering... Read
12 June 07 - ebiz - IBM Unveils Next Generation Informix Dynamic Server... Read
12 June 07 - computerworld.com - Will 'Cheetah' help IBM's Informix chase down market share?... Read
12 June 07 - Internetnews.com - No Data Can Outrun This 'Cheetah'... Read
12 June 07 - de.internet.com - IBM neuer Datenbank-Server mit Codenamen Cheetah ist fertig... Read
12 June 07 - verifox.de - IBM stärkt Datenbank-Portfolio mit neuem Informix Dynamic Server... Read
12 June 07 - golem.de - Informix 11 vorgestellt... Read
12 June 07 - Computerwoche.de - IBM stellt neue Informix-Version vor... Read
12 June 07 - IBM.de - IBM stärkt Datenbank-Portfolio mit neuem Informix Dynamic Server... Read
12 June 07 - Heise - IBM gibt Informix 11 frei... Read
25 May 07 - Taiwan.CNET.com - Local Taiwan Informix user group established... (Chinese language) ... Read
18 May 07 - ChannelWeb Network - IBM Musters Partners For Cheetah Release... Read
18 May 07 - eWeek.com - IBM Looks to 'Cheetah' to Speed Up Blade Servers... Read
7 May 07 - DB2 Magazine - SQL Shortcuts - Use these tricks to generate IDS SQL scripts... Read

Previous news items
 

Home Member Area About IIUG


Resources
IIUG Insider
IIUG Hotspots
IBM-Informix Links
IIUG RSS Feeds
Software Repository
Informix Products
Online Resources
Informix Library
Informix Books
IIUG Banners
Discussion
Technical SIGs
Non-technical
Other Discussion
Community
Events
Webcasts/Chat w Lab
IIUG TV
IIUG Sponsors
Informix Business Directory
IIUG Press Partners
Local User Groups
Job Board
Fun Stuff

[ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

Informix Forum

Re: Computing aggregates

Posted By: Jonathan Leffler
Date: Friday, 10 March 2006, at 1:05 a.m.

SAIRA VARGHESE wrote:
> Thanks for taking some time to respond... I developed a program that would
> insert a large # of rows into a table. This script is meant to calculate the
> total # of rows inserted in a single run of the program (there are rows in the
> table from previous runs) and # of rows / minute. You are right, sum(count(*))
> wouldn't work.
>
> I tried the following script and it gave me a syntax error at the character
> indicated by the carat sign - I think it is not allowing any function call in
> group by statement because I tried 'group by DATE(logdt)' which yielded the
> same result; 'group by 2' works fine.

I don't recall you saying which version of IDS you're using; IDS 10.00
has some enhancements in this area, IIRC - unless it was in 9.40.
Always include the version information; it helps people like me
respond more accurately.

> select count(*), EXTEND(logdt, YEAR TO MINUTE) as logdt
> from air_records
> group by 2, order by 2;
> --group by logdt order by logdt;
> --group by EXTEND(logdt,YEAR TO MINUTE)
>
> ^
> --group by DATE(logdt)
> Result is below:
>
> 3764 2006-03-07 14:30
> 10185 2006-03-07 14:31
> 1158 2006-03-07 14:32
> Now, is there any way to calculate the sum of the three counts in the script?

Yes - which way do you want to do it, and are there any constraints on us?

Option 1:

Add an 'INTO TEMP temp_data' clause and give the count column a name
(AS log_count, perhaps), and then get the base answers with 'SELECT *
FROM temp_data' and the aggregate with 'SELECT SUM(log_count) FROM
temp_data'?

Option 2:

Keep the base query as you have it now. Run a second query 'SELECT
COUNT(*) FROM air_records' to get the aggregate. This might well be
quicker if the second select can be left without any WHERE clause -
IDS can optimize that without needing to scan the whole table.

Option 3: Probably - but I don't think you need extra ways at this point.

--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/

[ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

Informix Forum is maintained by Administrator with WebBBS 5.12.

©2001 - 2007 International Informix Users Group.   All rights reserved.     Terms of use    
*** Powered By IBM Informix Dynamic Server V10.00 ***