IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Comparing VARG and VARCHAR


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Mon Dec 03, 2012 1:32 pm
Reply with quote

Hi,

I want to join two tables...

Say TableA, TableB.

Columns of TableA

C1 SMALLINT
C2 VARG(16)


Columns of TableB
C1 SMALLINT
C2 VARCHAR(40)

I have the below query.

Select * from TableA, TableB
where TableA.C2 = TableB.C2.

I want to know will there be any performance overhead in this case?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Dec 03, 2012 8:28 pm
Reply with quote

Hello,

How many rows are in the tables?

How are the keys defined for these tables?

How might a graphic value be equal to a varchar value?
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Tue Dec 04, 2012 10:48 am
Reply with quote

As of now I am not sure on the number of rows... Keys/Indexes are defined on different columns....

Varchar in Unicode can accommodate 1,2,3 byte char and Vargraphic is 2 byte char set.

I tried matching few rows, they were matching.... I think DB2 does implicit type conversion here.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Dec 04, 2012 9:14 pm
Reply with quote

Hello,

I suspect that if the WHERE has keys that are the same to match on, there would be little or no performance degredation (other than, of course, sheer volume.

Good luck, and we'd be interested to hear about how it goes icon_wink.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Comparing Header and Trailer. DFSORT/ICETOOL 7
No new posts Comparing Signed Packed decimal and p... SYNCSORT 2
No new posts Comparing Comp-3 fields with greater ... DFSORT/ICETOOL 11
No new posts Comparing inside same file DFSORT/ICETOOL 2
No new posts Comparing two sequential files COBOL Programming 14
Search our Forums:

Back to Top