• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to create mysql table with huge number of columns & rows by optimized way using Hibernate?

 
Ranch Hand
Posts: 630
Android Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using hibernate for communicate with mysql.
I create sample table with 2 columns & 1 row.
I can add row & fetch it by java program.

For 2 columns I create testtable.java

By this java file & create testtable.hbm.xml


For adding new line in table I use function as follows:-


If schema not present then I can create it & can add table in it by java program,
But Question come in mind, if I want to create 1 table with 10 Million columns & 10 Million columns rows, then by java how can I manage that?
Columns like column1, column2...column10000000.

How Can I by optimize way create it & add data in it?
Any one done that for study purpose?
 
Mandar Khire
Ranch Hand
Posts: 630
Android Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found that Limits on Table Column Count and Row Size,
So main question change,
If I want to create table with 4095 columns (1 column less than limit set by mysql) then how can I do that?

As I created table by query like

But I can not find optimize way for writing query for such huge table!
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You keep asking for the "optimized way" when you don't even have requirements yet. (No, "I want to create a table with 10 million columns" is not a requirement.) So you have things backwards. You can't ask for an optimized way before you have two or more ways to do something, and you don't even have a description of the "something" yet.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mandar Khire wrote:If I want to create table with 4095 columns (1 column less than limit set by mysql) then how can I do that?


If you want to do something like this, the first question you should ask yourself is "why would I even want to do this?". Such a high number of columns becomes unmanageable.
 
reply
    Bookmark Topic Watch Topic
  • New Topic