Save 
Join IIUG
 for   
 

Informix News
13 Jan 12 - MC Press online - Informix Dynamic Server Entices New Users with Free Production Edition ... Read
11 Jan 12 - Computerworld - Ecologic Analytics and Landis+Gyr -- Suitors Decide to Tie the Knot... Read
9 Jan 12 - planetIDS.com - DNS impact on Informix / Impacto do DNS no Informix... Read
8 Sep 11 - TMCnet.com - IBM Offers Database Solution to Enable Smart Meter Data Capture... Read
1 Aug 11 - IBM Data Management Magazine - IIUG user view: Happy 10th anniversary to IBM and Informix... Read
8 Jul 11 - Database Trends and Applications - Managing Time Series Data with Informix... Read
31 May 11 - Smart Grid - The meter data management pitfall utilities are overlooking... Read
27 May 11 - IBM Data Management Magazine - IIUG user view: Big data, big time ( Series data, warehouse acceleration, and 4GLs )... Read
16 May 11 - Business Wire - HiT Software Announces DBMoto for Enterprise Integration, Adds Informix. Log-based Change Data Capture... Read
21 Mar 11 - Yahoo! Finance - IBM and Cable&Wireless Worldwide Announce UK Smart Energy Cloud... Read
14 Mar 11 - MarketWatch - Fuzzy Logix and IBM Unveil In-Database Analytics for IBM Informix... Read
11 Mar 11 - InvestorPlace - It's Time to Give IBM Props: How many tech stocks are up 53% since the dot-com boom?... Read
9 Mar 11 - DBTA - Database Administration and the Goal of Diminishing Downtime... Read
2 Feb 11 - DBTAs - Informix 11.7 Flexible Grid Provides a Different Way of Looking at Database Servers... Read
27 Jan 11 - exactsolutions - Exact to Add Informix Support to Database Replay, SQL Monitoring Solutions... Read
25 Jan 11 - PR Newswire - Bank of China in the UK Works With IBM to Become a Smarter, Greener Bank... Read
12 Oct 10 - Database Trends and Applications - Informix 11.7: The Beginning of the Next Decade of IBM Informix... Read
20 Sep 10 - planetIDS.com - ITG analyst paper: Cost/Benefit case for IBM Informix as compared to Microsoft SQL Server... Read
20 Jul 10 - IBM Announcements - IBM Informix Choice Edition V11.50 helps deploy low-cost scalable and reliable solutions for Apple Macintosh and Microsoft Windows... Read
20 Jul 10 - IBM Announcements - Software withdrawal: Elite Support for Informix Ultimate-C Edition... Read
24 May 10 - eWeek Europe - IBM Supplies Database Tech For EU Smart Grid... Read
23 May 10 - SiliconIndia - IBM's smart metering system allows wise use of energy... Read
21 May 10 - CNET - IBM to help people monitor energy use... Read
20 May 10 - ebiz - IBM Teams With Hildebrand To Bring Smart Metering To Homes Across Britain... Read
19 May 10 - The New Blog Times - Misurare il consumo energetico: DEHEMS è pronto... Read
19 May 10 - ZDNet - IBM software in your home? Pact enables five-city smart meter pilot in Europe... Read
17 March 10 - ZDNet (blog) David Morgenstern - TCO: New research finds Macs in the enterprise easier, cheaper to manage than... Read
17 March 2010 - Virtualization Review - ...key components of Big Blue's platform to the commercial cloud such as its WebSphere suite of application ser vers and its DB2 and Informix databases... Read
10 February 2010 - The Wall Street Journal - International Business Machines is expanding an initiative to win over students and professors on its products. How do they lure the college crowd?... Read


End of Support Dates

IIUG on Facebook IIUG on Twitter


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

Admin Tools Forum

Re: how to use multiple temp db spaces

Posted By: Keith Simmons
Date: Monday, 22 December 2008, at 4:04 a.m.

In Response To: Re: how to use multiple temp db spaces (KRISHNAN BALASUBRAMANIAN)

2008/12/22 KRISHNAN BALASUBRAMANIAN <krishnanbalasubramanian@rediffmail.com>:
> Thanks Keith,
>
> Here is the program we ahve written:
> database ibs7000_test2
> define rec_main record
> fld_1 char(1),
> fld_2 char(1),
> fld_3 char(9),
> fld_4 char(2),
> fld_5 char(1),
> fld_6 char(9),
> fld_7 char(1),
> fld_8 char(9),
> fld_9 date,
> fld_10 char(9),
> fld_11 char(1),
> fld_12 datetime year to second,
> fld_13 varchar(10,0),
> fld_14 varchar(16,0)
> end record
> main
>
> define l_index integer
> define l_cnt integer
> whenever error call error_log
> clear screen
> display "Creating Temp Table....."
> call create_tmp_tbl()
> display "Loading Data......"
> let l_index = 0
> while(l_index < 15000 )
> call load_data()
> select count(*) into l_cnt
> from t_sample_in
> display "No.of Records Loaded: ", l_cnt
> let l_index = l_index + 1
> end while
>
> declare cur_bptr cursor for
> select * from t_sample_in
> let l_index = 0
> start report rbptr to "/tmp/trail2.rpt"
> clear screen
> display "Reporting......"
> while(l_index < 50 )
> run "rm -f /tmp/trail2.rpt 2>/dev/null"
> foreach cur_bptr into rec_main.*
> output to report rbptr(rec_main.*)
> end foreach
> let l_index = l_index + 1
> display "NO:OF RPTS", l_index
> end while
>
> finish report rbptr
> end main
> function create_tmp_tbl()
>
> create temp table t_sample_in
> (
> fld_1 char(1),
> fld_2 char(1),
> fld_3 char(9),
> fld_4 char(2),
> fld_5 char(1),
> fld_6 char(9),
> fld_7 char(1),
> fld_8 char(9),
> fld_9 date,
> fld_10 char(9),
> fld_11 char(1),
> fld_12 datetime year to second,
> fld_13 varchar(10,0),
> fld_14 varchar(16,0)
> )with no log
> end function
>
> function load_data()
> load from "/tmp/sample_data.unl"
> insert into t_sample_in
> end function
>
> function error_log()
> call startlog("/tmp/sample_err.log")
> call errorlog(err_get(status))
>
> exit program
> end function
> report rbptr(rec)
>
> define rec record
> fld_1 char(1),
> fld_2 char(1),
> fld_3 char(9),
> fld_4 char(2),
> fld_5 char(1),
> fld_6 char(9),
> fld_7 char(1),
> fld_8 char(9),
> fld_9 date,
> fld_10 char(9),
> fld_11 char(1),
> fld_12 datetime year to second,
> fld_13 varchar(10,0),
> fld_14 varchar(16,0)
> end record
>
> order by rec.fld_1,rec.fld_4
> format
> page header
> print "*******Sample report *******"
> after group of rec.fld_4
> print "No: of Records ", count(*)
> on every row
> print
> column 1, rec.fld_1,
> rec.fld_2,
> rec.fld_3,
> rec.fld_4,
> rec.fld_5,
> rec.fld_6,
> rec.fld_7
> end report
>
> *******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
KRISHNAN

This will create a temp table in true temp spaces (those marked 'T' on
onstat -d), but will use a random temp dbspace if you have more than
one configured. Also the sort in the report will create two sort
'files' the same size as your table in your temp spaces (one in each
if two or both in the same). Your records are around 80 bytes long,
multiply by the number of records to be loaded, then double (if you
only have two temp spaces, or triple if only one) and this will tell
you how big each temp space needs to be.
Might I suggest you place an index on your temp table (after loading)
on cols fld_1 and fld_4 and put the order by in your cursor rather
than in the report. Also just select the required fields in the
cursor, not the entire record, that will improve run speed.

Keith

Messages In This Thread

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

Admin Tools Forum is maintained by Administrator with WebBBS 5.12.