I create database objects in my Java application and try to rationalize between using Integer or Long as the class type of the id field. I use Hibernate as my ORM, which in turn maps this field to a column in the HSQLDB database.
My struggle is this: Long is obviously larger and will handle more records, but at a very low level, I know that in the past (32-bit systems) the level levels in the OS would be 32 bits wide. IE: A long read will take two passes ... is this the right way of thinking?
If I use Long today, will my HSQLDB queries be slower than if I were using Integer?
IE: HSQLDB must somehow use multiple read passes ... or use a large internal structure ... or add two Integer-sized columns too ... or is something else clearly imperfect? Or is it somehow controversial with today's 64-bit processing - which should process Long in one read (Long is 64 bits)?
source share