Hi, all

I am trying to know the performance difference between
mapping number column to long vs BigDecimal. I did
following test.

1) I loaded over 200k records in the table.
2) I ran a test to retrieve all records in the table
as an iterator and then loop over the iterator to get
each element and assign it to a value object.
3) It took 145 seconds, if all number fields are
defined as DECIMAL/BigDecimal.
4) I changed one column, which is the primary key of
this table to BIGINT/long and ran the same test. It
took 109 seconds.
5) I changed two more non-primary key columns to
BIGINT/long. It took 105 seconds.
6) I changed the primary key column back to
DECIMAL/BigDecimal, but leave the other two as
BIGINT/long. It took 134 seconds.

>From the test, looks like BIGINT/long is faster than
DECIMAL/BigDecimal. But I still have two questions.

1) Why the difference is bigger for primary column?
2) Is the above test result what you expected? Can
anybody explain the reson behind the scene.

Any help would be much appreciated.

Thanks,
Zhe


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to