{"id":478,"date":"2005-10-03T12:20:46","date_gmt":"2005-10-03T02:20:46","guid":{"rendered":"http:\/\/www.flamingspork.com\/blog\/?p=478"},"modified":"2005-10-03T12:23:31","modified_gmt":"2005-10-03T02:23:31","slug":"a-funky-thing-done-last-week","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2005\/10\/03\/a-funky-thing-done-last-week\/","title":{"rendered":"a funky thing done last week&#8230;"},"content":{"rendered":"<p>still have to talk to people about standards for this sort of thing and all that. But as a first checkin &#8211; funkyness++!<\/p>\n<pre>\r\nmysql> select * from INFORMATION_SCHEMA.DATAFILES;  select * \r\nfrom INFORMATION_SCHEMA.TABLESPACES;\r\nEmpty set (0.03 sec)\r\n\r\nEmpty set (0.00 sec)\r\n\r\nmysql> CREATE TABLESPACE ts1 ADD DATAFILE 'datafile.dat' USE \r\nLOGFILE GROUP lg1 INITIAL_SIZE = 12M ENGINE NDB;\r\nQuery OK, 0 rows affected (2.35 sec)\r\n\r\nmysql> select * from INFORMATION_SCHEMA.DATAFILES;  select * \r\nfrom INFORMATION_SCHEMA.TABLESPACES;\r\n+--------------+--------+--------------+----------+------+------------+\r\n| NAME         | ENGINE | PATH         | SIZE     | FREE | TABLESPACE |\r\n+--------------+--------+--------------+----------+------+------------+\r\n| datafile.dat | NDB    | datafile.dat | 12582912 |   11 |            |\r\n+--------------+--------+--------------+----------+------+------------+\r\n1 row in set (0.00 sec)\r\n\r\n+------+--------+---------+-------------+-----------------------+\r\n| NAME | ENGINE | VERSION | EXTENT_SIZE | DEFAULT_LOGFILE_GROUP |\r\n+------+--------+---------+-------------+-----------------------+\r\n| ts1  | NDB    |       1 |     1048576 |                     0 |\r\n+------+--------+---------+-------------+-----------------------+\r\n1 row in set (0.00 sec)\r\n\r\nmysql> CREATE TABLE t1 \r\n(pk1 int not null primary key auto_increment,\r\n b int not null, \r\nc int not null) \r\ntablespace ts1 storage disk engine ndb; \r\nQuery OK, 0 rows affected (0.62 sec)\r\n\r\nmysql> insert into t1 (b,c) values (1,2),(2,3),(3,4),(1,2),(2,3),(3,4),(1,2),(2,3),(3,4),\r\n(1,2),(2,3),(3,4),(1,2),(2,3),(3,4),(1,2),(2,3),(3,4),(1,2),(2,3),(3,4),(1,2),\r\n(2,3),(3,4),(1,2),(2,3),(3,4),(1,2),(2,3),(3,4),(1,2),(2,3),(3,4),(1,2),(2,3),(3,4);\r\nQuery OK, 36 rows affected (0.11 sec)\r\nRecords: 36  Duplicates: 0  Warnings: 0\r\n\r\nmysql> select * from INFORMATION_SCHEMA.DATAFILES;  select * \r\nfrom INFORMATION_SCHEMA.TABLESPACES; \r\n+--------------+--------+--------------+----------+------+------------+ \r\n| NAME         | ENGINE | PATH         | SIZE     | FREE | TABLESPACE |\r\n+--------------+--------+--------------+----------+------+------------+\r\n| datafile.dat | NDB    | datafile.dat | 12582912 |    9 |            |\r\n+--------------+--------+--------------+----------+------+------------+\r\n1 row in set (0.02 sec)\r\n\r\n+------+--------+---------+-------------+-----------------------+\r\n| NAME | ENGINE | VERSION | EXTENT_SIZE | DEFAULT_LOGFILE_GROUP |\r\n+------+--------+---------+-------------+-----------------------+\r\n| ts1  | NDB    |       1 |     1048576 |                     0 |\r\n+------+--------+---------+-------------+-----------------------+\r\n1 row in set (0.00 sec)\r\n\r\nmysql> CREATE TABLESPACE ts2 ADD DATAFILE 'datafile2.dat' \r\nUSE LOGFILE GROUP lg1 INITIAL_SIZE = 12M ENGINE NDB;\r\nQuery OK, 0 rows affected (2.18 sec)\r\n\r\nmysql> select * from INFORMATION_SCHEMA.DATAFILES;  select * \r\nfrom INFORMATION_SCHEMA.TABLESPACES;\r\n+---------------+--------+---------------+----------+------+------------+\r\n| NAME          | ENGINE | PATH          | SIZE     | FREE | TABLESPACE |\r\n+---------------+--------+---------------+----------+------+------------+\r\n| datafile2.dat | NDB    | datafile2.dat | 12582912 |   11 |            |\r\n| datafile.dat  | NDB    | datafile.dat  | 12582912 |    9 |            |\r\n+---------------+--------+---------------+----------+------+------------+\r\n2 rows in set (0.02 sec)\r\n\r\n+------+--------+---------+-------------+-----------------------+\r\n| NAME | ENGINE | VERSION | EXTENT_SIZE | DEFAULT_LOGFILE_GROUP |\r\n+------+--------+---------+-------------+-----------------------+\r\n| ts1  | NDB    |       1 |     1048576 |                     0 |\r\n| ts2  | NDB    |       1 |     1048576 |                     0 |\r\n+------+--------+---------+-------------+-----------------------+\r\n2 rows in set (0.00 sec)\r\n\r\nmysql> ALTER TABLESPACE ts1 ADD DATAFILE 'datafile3.dat' \r\nINITIAL_SIZE=12M ENGINE NDB;\r\nQuery OK, 0 rows affected (1.85 sec)\r\n\r\nmysql> select * from INFORMATION_SCHEMA.DATAFILES;  select *\r\n from INFORMATION_SCHEMA.TABLESPACES;\r\n+---------------+--------+---------------+----------+------+------------+\r\n| NAME          | ENGINE | PATH          | SIZE     | FREE | TABLESPACE |\r\n+---------------+--------+---------------+----------+------+------------+\r\n| datafile2.dat | NDB    | datafile2.dat | 12582912 |   11 |            |\r\n| datafile3.dat | NDB    | datafile3.dat | 12582912 |   11 |            |\r\n| datafile.dat  | NDB    | datafile.dat  | 12582912 |    9 |            |\r\n+---------------+--------+---------------+----------+------+------------+\r\n3 rows in set (0.02 sec)\r\n\r\n+------+--------+---------+-------------+-----------------------+\r\n| NAME | ENGINE | VERSION | EXTENT_SIZE | DEFAULT_LOGFILE_GROUP |\r\n+------+--------+---------+-------------+-----------------------+\r\n| ts1  | NDB    |       1 |     1048576 |                     0 |\r\n| ts2  | NDB    |       1 |     1048576 |                     0 |\r\n+------+--------+---------+-------------+-----------------------+\r\n2 rows in set (0.00 sec)\r\n<\/pre>\n<p>the &#8216;free&#8217; column is really the number of free extents. Not exactly ideal&#8230; maybe&#8230; but since that&#8217;s the unit of allocation in the data files, it sort of makes sense. The other option is to list number of extents * extent size. Maybe that&#8217;s clearer for people&#8230; there is the option of denormalising the tables and have extent size in the DATAFILES table too. There is something in my brain that makes that a hard leap though.<\/p>\n<p>Although&#8230;. if you&#8217;re going to be querying the tables directly and not just using a pretty gui on top of it all, you should probably know what you&#8217;re doing anyway.<\/p>\n<p>Although, both a great benefit (and curse) of commoditising the database market is the fact that you get all sorts as users. This is interesting in cluster as it is naturally a bit more complex than a simple client-server RDBMS.<\/p>\n<p>we also need a NODE column as well. which will probably cause confusion for non-cluster users and the like :)<\/p>\n<p>(for the unintiated, this is work being done in a branch off the 5.1 tree for NDB disk data. we&#8217;ll push it to the main 5.1 tree at some point). don&#8217;t go thinking this is production ready any time soon (in other words insert a standard disclaimer).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>still have to talk to people about standards for this sort of thing and all that. But as a first checkin &#8211; funkyness++! mysql> select * from INFORMATION_SCHEMA.DATAFILES; select * from INFORMATION_SCHEMA.TABLESPACES; Empty set (0.03 sec) Empty set (0.00 sec) &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2005\/10\/03\/a-funky-thing-done-last-week\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[14],"tags":[],"class_list":["post-478","post","type-post","status-publish","format-standard","hentry","category-mysql"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5a6n8-7I","jetpack-related-posts":[{"id":578,"url":"https:\/\/www.flamingspork.com\/blog\/2006\/02\/15\/information_schemafiles-querying-disk-usage-from-sql\/","url_meta":{"origin":478,"position":0},"title":"INFORMATION_SCHEMA.FILES (querying disk usage from SQL)","author":"Stewart Smith","date":"2006-02-15","format":false,"excerpt":"In MySQL 5.1.6 there's a new INFORMATION_SCHEMA table. Currently, it only has information on files for NDB but we're hoping to change that in a future release (read: I think it would be neat). This table is a table generated by the MySQL server listing all the different files that\u2026","rel":"","context":"In &quot;mysql&quot;","block_context":{"text":"mysql","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/mysql\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1383,"url":"https:\/\/www.flamingspork.com\/blog\/2009\/02\/02\/row-id-in-mysql-and-drizzle-and-the-engines\/","url_meta":{"origin":478,"position":1},"title":"row id in MySQL and Drizzle (and the engines)","author":"Stewart Smith","date":"2009-02-02","format":false,"excerpt":"Some database engines have a fundamental concept of a row id. The row id is everything you need to know to locate a row. Common uses include secondary indexes (key is what's indexed, value is rowid which you then use to lookup the row). One design is the InnoDB method\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1229,"url":"https:\/\/www.flamingspork.com\/blog\/2008\/10\/14\/mysql-cluster-ndb-on-win32-progress\/","url_meta":{"origin":478,"position":2},"title":"MySQL Cluster (NDB) on Win32 progress","author":"Stewart Smith","date":"2008-10-14","format":false,"excerpt":"Many things have been happenning in the land of NDB on Win32 as of late. I've fixed about 700 compiler warnings (some of which were real bugs) leaving about 161 to go on Win32 (VS2003). We're getting a few more warnings on Win64 (some of which look merely semantic, while\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.flamingspork.com\/blog\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":729,"url":"https:\/\/www.flamingspork.com\/blog\/2006\/08\/25\/storing-passwords-securly-in-mysql\/","url_meta":{"origin":478,"position":3},"title":"Storing Passwords (securly) in MySQL","author":"Stewart Smith","date":"2006-08-25","format":false,"excerpt":"Frank talks about Storing Passwords in MySQL. He does, however, miss something that's really, really important. I'm talking about the salting of passwords. If I want to find out what\u00c2\u00a0 5d41402abc4b2a76b9719d911017c592 or 015f28b9df1bdd36427dd976fb73b29d MD5s mean, the first thing I'm going to try is a dictionary attack (especially if i've seen\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.flamingspork.com\/blog\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":914,"url":"https:\/\/www.flamingspork.com\/blog\/2007\/11\/09\/mysql-5122-stew2\/","url_meta":{"origin":478,"position":4},"title":"mysql-5.1.22-stew2","author":"Stewart Smith","date":"2007-11-09","format":false,"excerpt":"New: Updated NDB Compressed LCP and BACKUP patches (now with O_DIRECT support) InnoDB patch for Windows that should give ~5x improvement on commits\/sec (Bug31876) Everything in current telco-6.3 tree (ndb ~6.3.5) Lots of NDB improvements and new features over regular 5.1. WL3686 Remove read before update WL2680 NDB Batched Update\u2026","rel":"","context":"In &quot;mysql&quot;","block_context":{"text":"mysql","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/mysql\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3304,"url":"https:\/\/www.flamingspork.com\/blog\/2013\/05\/13\/the-mysql-cluster-storage-engine\/","url_meta":{"origin":478,"position":5},"title":"The MySQL Cluster storage engine","author":"Stewart Smith","date":"2013-05-13","format":false,"excerpt":"This is one close to my heart. I've recently written on other storage engines:\u00c2\u00a0Where are they now: MySQL Storage Engines,\u00c2\u00a0The MERGE storage engine: not dead, just resting\u00e2\u20ac\u00a6. or forgotten\u00c2\u00a0and The MEMORY storage engine. Today, it's the turn of MySQL Cluster. Like InnoDB, MySQL Cluster started outside of MySQL. Those of\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/478","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/comments?post=478"}],"version-history":[{"count":0,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/478\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=478"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=478"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}