|
Post by ezmoney on Mar 18, 2014 15:49:37 GMT -5
I am trying to put together a very large MySQL table with over 35 million rows in the database MySQL.
I'm new to this so I am just trying to understand how this works, and any limits.
I am wondering how I can sort the new items in order while someone is still using the MySQL file.
Will the system take care of all of this?
I will need to add more items and then sort them into the proper order, the more entries to any one point will then need to be sorted to order.
I was thinking of using an index sort then the pointer would point to each row in the MySQL database table.
I would have to create the sortkey for each row in the database and then transfer that to some sort of an array to sort.. the index would point to the row.
Then when finished I would be able to search thru the database in sorted order and then send the rows out to the customer for display.
to narrow down the search I was thinking of using the first character to find all of those and illuminate the search of 35 million records. maybe some of you know the trick to finding something quick or maybe the MySQL will figure that out too.
for j=1 to #rownumber I=idx(j) display the row that matched what the customer was looking for. next j
|
|
neal
Full Member
Posts: 104
|
Post by neal on Mar 18, 2014 18:59:02 GMT -5
If you are storing your data in sqlite (or mysql) the database will handle all the sorting and searching for you, ie: SELECT COL1, COL2 FROM TABLE1 ORDER BY COL1 will return the table data sorted by column COL1 and likewise SELECT COL1, COL2 FROM TABLE1 WHERE COL1 = 'something' will return only those row of the table where columns COL1 is 'something' No need for you to code either searching or sorting. See www.w3schools.com/sql/default.asp for an introduction to SQL.
|
|
|
Post by meerkat on Mar 19, 2014 7:24:50 GMT -5
Since you will have 35M records, the only thing I'd suggest is that you place an index on items you want to sort. SQLite and other databases use a B+ tree to index and therefore all items are in sequence as you enter data. Remember SQLite is not managed like MYsql. If you have a lot of traffic, be aware that since SQLite is not managed, locks do not take place at the record level, they lock the entire DB for that instance. en.wikipedia.org/wiki/B+_treeIf you want to generate Run Basic code from the database download the SQLite manager. You can enter a query, execute it, and then generate the Run Basic code from the query. Using the rbGen code, you can give it a database table and it will generate a management system for the table. You can also give it tables relations to generate drop down, radio, or check boxes used for selection in the maintenance section of the code. Sqlite management download at:http://www.kneware.com/SQLite/index.html RBgen at:http://kneware.com/RBgen/index.htm
|
|