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 ]

Classics Forum

RE: SERIAL to INTEGER key joins vs. CHAR to CHAR.

Posted By: Zev Berezin
Date: Tuesday, 9 March 2010, at 3:18 p.m.

In Response To: Re: SERIAL to INTEGER key joins vs. CHAR to CHAR. (Pankrich Khanthasa-ard)

Are you sure about that last paragraph? I know when adding data it will not maintain the physical order of the cluster, and therefore over time an alter index indexname to cluster should be executed.

I am not sure when updating data.

Zev Berezin

-----Original Message-----
From: classics-bounces@iiug.org [mailto:classics-bounces@iiug.org] On Behalf Of Pankrich Khanthasa-ard
Sent: Monday, March 08, 2010 11:01 AM
To: classics@iiug.org
Subject: Re: SERIAL to INTEGER key joins vs. CHAR to CHAR. [3518]

I just have a little bit doubt why your CUSTOMER.cust_name can be unique. I
mean it's possible to have many "John" in your villege.

Anyway, why don't you try in simplest way.
- Primary key with unique index on CUSTOMER.cust_id
- Duplicate index on CUSTOMER.cust_name
- Foreign key with normal index on LOANS.cust_id

Don't forget about the cluster index will generate more cost when you try to
modify data because DBMS has to maintain the physical data ordered.
So it will be better to avoid this index option in OLTP but not in DSS.

________________________________
From: FRANK ROTOLO <frank.pr@msn.com>
To: classics@iiug.org
Sent: Mon, March 8, 2010 12:24:40 PM
Subject: SERIAL to INTEGER key joins vs. CHAR to CHAR. [3515]

OK, so I have a "customers" table with:

customers.cust_id SERIAL(0),
customers.cust_name CHAR(30),
...
...

and a "loans" table with:

loans.cust_id INTEGER,
...
...

the tables are joined by their cust_id columns.
we are told this is the normally correct way to join master/detail tables.
it allows us to make changes in the customers name without loosing the join.

To lookup a customer's loans, my users query the master table using wildcard
names, example: LAS*SUR*F* to locate customer LASTNAME SURNAME, FIRSTNAME
Then they make the loans table active to make payment updates.
So, I created the following index:

CREATE UNIQUE CLUSTER INDEX custname ON customers(cust_name);

so that any new customers are physically ordered by name in customers.dat
great, but I'm not able to order the loans detail table the same way!
the best I could do for it is:

CREATE CLUSTER INDEX loansclidx ON loans(cust_id);

so that each customers loans are physically grouped together in loans.dat
Now, everytime a new customer is added, the next available serial cust_id
is assigned to the customer, regardless of the customers name. As a result,
the rows in the loans table are not in the same order as the customer table,
and fetching each customers loans takes longer because although the loans rows
are grouped together in ascending order by loans.cust_id, they are not ordered
the same way as the customers name in the master.

I experimented by doing away with customers.cust_id = loans.cust_id, making
customers.cust_name the PRIMARY KEY which now joins loans.cust_name (an added
column). Although this is not the "correct" way to define joins, because if
you make a change in the master tables customer name the join is severed in
the detail table, unless you update each detail row with the new change.
But now we have:

CREATE UNIQUE CLUSTER INDEX custname ON customers(cust_name);
CREATE CLUSTER INDEX loanname ON loans (cust_name);

and response time is incredible!

Is there a better way of doing this?

*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.

*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.

Messages In This Thread

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

Classics Forum is maintained by Administrator with WebBBS 5.12.