I want to give this 10 upvotes. This is one of those things you only see on HN occasionally, and it's full of all kinds of awesome little nuggets. That command to get the count from the information_schema in and of itself is gold (I now know about the tee command)
Loading half a billion rows into MySQL
11–20 of 101 posts
Re: Loading half a billion rows into MySQL
#12I want to give this 10 upvotes. This is one of those things you only see on HN occasionally, and it's full of all kinds of awesome little nuggets. That command to get the count from the information_schema in and of itself is gold (I now know about the tee command)
Re: Loading half a billion rows into MySQL
#13SELCT table_rows Should be, SELECT table_rows
Re: Loading half a billion rows into MySQL
#14I want to give this 10 upvotes. This is one of those things you only see on HN occasionally, and it's full of all kinds of awesome little nuggets. That command to get the count from the information_schema in and of itself is gold (I now know about the tee command)
Also the while; do; loop could probably be replaced with 'watch'.
Re: Loading half a billion rows into MySQL
#15I want to give this 10 upvotes. This is one of those things you only see on HN occasionally, and it's full of all kinds of awesome little nuggets. That command to get the count from the information_schema in and of itself is gold (I now know about the tee command)
I ran this select from information_schema to get the count of a table with aprox 1.2 million rows. each time I run the query, though, the number returned is different. it seems to vary by about 200k either way. does anybody know why that would be happening?
From http://dev.mysql.com/doc/refman/5.0/en/tables-table.html:
> For InnoDB tables, the row count is only a rough estimate used in SQL optimization.
Re: Loading half a billion rows into MySQL
#16FTA: "...I decided to migrate the existing system into a single table setup." "Alternative Proposed Solutions: MySQL Partitioning and Redis" I'm surprised he didn't consider at Mongo, Couch, etc.
Re: Loading half a billion rows into MySQL
#17We use oracle because the partitioning options are better and bitmapped indexes. (We wanted more partitions so we could use a hierarchical triangular mesh for point-radius searches)
Re: Loading half a billion rows into MySQL
#18(LOAD DATA INFILE has this ticket from 2006, that,sometime during the 2000's was converted to a feature request
http://bugs.mysql.com/bug.php?id=23212
I think that's why my load does
FIELDS ESCAPED BY '\\'
but it's been so long i can't remember (at this point a lot fo folks would mention Postgres, but i'll refrainRe: Loading half a billion rows into MySQL
#19Re: Loading half a billion rows into MySQL
#20What if you partition by HASH(user_id) instead of partitioning by month (http://dev.mysql.com/doc/refman/5.5/en/partitioning-hash.htm...)?