The new EricMartindale.com is an experiment in data aggregation, and might have a few bugs. Feel free to explore, and then provide feedback directly to @martindale.

search results for mysql

MySQL Cluster: Generating Partition Reports

If you're using MySQL Cluster and have recently added a nodegroup, you can use the following code to generate a report of what tables are currently partitioned across the nodes as you apply ALTER ONLINE TABLE ... REORGANIZE PARTITION to them to get them partitioned:

select count(p.table_name) as partitions, p.table_schema, p.table_name from tables t join partitions p on (t.table_schema=p.table_schema and t.table_name=p.table_name) where t.engine='ndbcluster' group by p.table_schema, p.table_name order by partitions desc;

You'll get a nice clean report of all your tables, what schema they belong to, and how many partitions they have. Use in combination with my method of finding the largest tables in MySQL and you'll ensure smooth growth of your cluster!

0 Replies

Replies are automatically detected from social media, including Twitter, Facebook, and Google+. To add a comment, include a direct link to this post in your message and it'll show up here within a few minutes.

Find Largest Tables in MySQL

If you're trying to find what tables in your MySQL deployment are consuming the most amount of space, you can use the following query to find this information directly from the information schema.

SELECT CONCAT(table_schema, '.', table_name), CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows, CONCAT(ROUND(data_length / ( 1024 1024 1024 ), 2), 'G') DATA, CONCAT(ROUND(index_length / ( 1024 1024 1024 ), 2), 'G') idx, CONCAT(ROUND(( data_length + index_length ) / ( 1024 1024 1024 ), 2), 'G') total_size, ROUND(index_length / data_length, 2) idxfrac, engine FROM information_schema.TABLES ORDER BY data_length + index_length DESC LIMIT 25;

You'll get a list of the top 25 tables by total size (index size + data size), how many rows they have, and the engine they are using to be stored. Being able to see what engine is being used is especially helpful when running MySQL Cluster.

0 Replies

Replies are automatically detected from social media, including Twitter, Facebook, and Google+. To add a comment, include a direct link to this post in your message and it'll show up here within a few minutes.

Letter Sweep

Following suit with the likes of Tim Bray and Eric Meyer, I figured I'd throw together my browser's letter sweep tonight.

  • [A]dmin Site. Yeah, I guess I would be visiting the admin panel for this. Quite frequently.
  • Mirascape's [B]log. An infrequent haunt of mine, but fairly obvious.
  • [C]MON. Cluster Monitor for MySQL Cluster, something I almost always have open.
  • Google [D]ocs. This one is painfully obvious, I use Google Docs extensively.
  • [E]ricMartindale.com. Okay, that's a gimme. Does this make me egocentric?
  • [F]acebook. I'm actually fairly ashamed of this one. Why can't I have a cool F site? sadface
  • [G]mail. Three accounts linked using Google's Multiple Sign-in. Open [almost] all day.
  • [H]ighcharts JS. A pretty kick-ass Javascript library for generating charts on the clientside.
  • [I]nternal Discussion. A site for communication with my team. :)
  • [J]Query Mobile Demo, 1.0 alpha 3. I've been spending a lot of time toying with jQuery Mobile, seeing where it's going compared to Sencha Touch.
  • [K]r.github.com. Keith Rarick's GitHub redirect. Total ass-kicker.
  • [L]inkedIn. Pretty straightforward, between hiring for our team at @Mirascape and the travel to and from various conferences and Meetups lately.
  • [M]irascape. The augmented reality platform I'm responsible for.
  • [N]oxBot. A nice PHP-powered IRC bot with various plugins. A bit out of date, but very powerful. Been using it for a couple things lately.
  • [O]K, QR Me!. A QR Code-generating link shortener I built.
  • [P]ostmark. Best Email delivery service I've used. Nice RESTful API, flat rate for emails sent.
  • [Q]uora. These guys nail Q&A, and they're doing it pretty well. Check out all their buzz, too. But for some reason, I just don't stick.
  • Google [R]eader. “From your 1,040 subscriptions, over the last 30 days you read 21,549 items, clicked 274 items, starred 853 items, shared 37 items, and emailed 8 items.” -- </stats>
  • [S]erver Stats for Mirascape. Powered by Munin, it's how I keep track of the status and metrics of all my servers.
  • [T]witter. Not surprising. I love their webapp for my personal use, but own and manage at least five accounts using SplitTweet.
  • [U]serVoice. Pretty sweet tool I use for giving the communities I manage a good way to build a consensus on what they desire most. Examples I run: for RolePlayGateway, and EVE UserVoice for EVE Online.
  • Google [V]oice. Allows me to use SMS from my computer, read (as opposed to listen to) voicemail. Great tool. If only it supported MMS.
  • [W]achovia. One of the places I do banking.
  • [X]DA Developers. An indisposable resource for getting rid of carrier-installed crap and running my own choice of software on the hardware I purchased!
  • [Y]ouTube. Another big namer. No surprise.
  • [Z]ecco. Where I trade most of my public stocks. :)

Surprisingly populist, and there's a lot of Google-owned properties in there. I'm also using Chromium, so I think it prefers the roots of the sites I visit instead of searching through my history for individual pages.

0 Replies

Replies are automatically detected from social media, including Twitter, Facebook, and Google+. To add a comment, include a direct link to this post in your message and it'll show up here within a few minutes.

Mac versus Linux

I had a pleasant conversation with a Mac fanboi, this morning.

(08:51:01 AM) Linux User: Do Macs come with an SSH server by default?
(08:51:12 AM) Mac User: bluh...huh?
(08:51:19 AM) Mac User: just woke up
(08:51:22 AM) Linux User: Oh, lol.
(08:51:26 AM) Linux User: Good morning, sunshine.
(08:51:30 AM) Mac User: lol
(08:51:40 AM) Linux User: I've been at work for an hour. ;P
(08:51:57 AM) Linux User: Anyways - does the default Mac have an SSH server?
(08:51:57 AM) Mac User: now...what are you babbling about?
(08:53:25 AM) Mac User: no, but ssh is supported for X11 apps
(08:54:22 AM) Mac User: ....x11 being the x window environment in the Mac OS
(08:54:47 AM) Linux User: Right.
(08:55:22 AM) Linux User: So - X11 applications can SSH to other locations?
(08:55:58 AM) Linux User: And - what's the Mac equivalent of a repository, and/or aptitude/apt-get/yum?
(08:56:01 AM) Mac User: I really don't know, I haven't messed with it
(08:56:12 AM) Mac User: what the fuck are those?
(08:56:46 AM) Linux User: I can go to the command line here, and say... "apt-get install " and it'll download and install that program from the repository.
(08:57:53 AM) Mac User: ...99% of Mac users don't go "Command-Line Commando" on their system....
(08:57:59 AM) Linux User: Also, if the program has any dependencies - it'll get those, too.
(08:58:00 AM) Mac User: so...enjoy that....
(08:58:11 AM) Linux User: Oh, it has a GUI, too.
(08:58:22 AM) Mac User: website?
(08:59:02 AM) Linux User: It's a core component, it doesn't particularly have its own site.
(08:59:22 AM) Linux User: Mac doesn't have an application finder and installer type thing?
(08:59:24 AM) Mac User: of what?
(08:59:27 AM) Mac User: no
(08:59:30 AM) Linux User: Weird.
(08:59:38 AM) Mac User: OMFG!!!! NO!!!! WHAT WILL I DO!???!?!?
(08:59:51 AM) Linux User: I was trying to install openssh-server on a friend's mac...
(08:59:57 AM) Mac User: y'all pc ppl always find the weirdest off-beat shit to pick at
(09:00:05 AM) Linux User: Mac's are PCs to, ho.
(09:00:16 AM) Linux User: Understand the word Personal Computer?
(09:00:21 AM) Mac User: uh, by the definition "personal computer" only
(09:00:38 AM) Linux User: PCs also don't have to run Microshaft.
(09:00:43 AM) Mac User: but be it known that a pc is a pc and a Mac is a Mac
(09:01:01 AM) Linux User: Considering Macs aren't "Macs" so much anymore, without the kooky PPC crap.
(09:01:10 AM) Mac User: ?
(09:01:42 AM) Linux User: They're regular PCs, now. I can install Windows on a Mac, I can install Plan9, MacOS, Linux.
(09:01:52 AM) Linux User: They don't use PPC anymore, right?
(09:02:05 AM) Mac User: you can't remove the Mac OS, though
(09:02:10 AM) Linux User: ...want to bet?
(09:02:13 AM) Mac User: yup
(09:02:16 AM) Mac User: go ahead
(09:02:20 AM) Linux User: LOL.
(09:02:31 AM) Mac User: remove the Mac OS, and then lemme know what you plan to do
(09:02:35 AM) Linux User: Anyways - MacBook pro - does it have more than one button?
(09:02:45 AM) Mac User: FUCK NO!!!!
(09:02:49 AM) Linux User: Alright, nevermind then.
(09:02:58 AM) Mac User: now, shoo
(09:02:59 AM) Linux User: I was going to buy one, because they're sexy.
(09:03:01 AM) Mac User: go buy a dell
(09:03:22 AM) Linux User: Dell is increasing their Linux support.
(09:03:23 AM) Linux User: :)
(09:05:19 AM) Mac User: that is to say that they now have some kind of linux support?
(09:05:52 AM) Linux User: They've always had Linux support, but it's been somewhat hidden.
(09:06:00 AM) Mac User: pphhhht
(09:06:12 AM) Linux User: They're increasing client awareness of the option, now.
(09:06:29 AM) Mac User: ya know, it really doesn't mean anything to me
(09:07:11 AM) Linux User: I was considering purchasing a Macbook and installing Ubuntu on it, for my laptop.
(09:07:25 AM) Mac User: I can run any other OS I want, should I happen to have a sudden drop in IQ, and my machine is pretty awesome.....so....
(09:07:55 AM) Mac User: why would you buy a Mac to run something you can run on a dell?
(09:08:01 AM) Mac User: why?
(09:08:04 AM) Linux User: Because Macs are sexier?
(09:08:08 AM) Linux User: I don't want an ugly dell.
(09:08:23 AM) Mac User: uh, yeah, and at least half the "sexier" is in the GUI
(09:08:28 AM) Linux User: Not at all.
(09:08:35 AM) Linux User: My GUI is 100% more teh sex.
(09:08:45 AM) Mac User: ......wow
(09:08:47 AM) Mac User: um
(09:08:48 AM) Linux User: http://www.youtube.com/watch?v=nzb3MSp82Vs
(09:08:49 AM) Mac User: no
(09:08:51 AM) Linux User: :)
(09:09:05 AM) Linux User: You can't install Beryl or even Compiz in MacOS, can you?
(09:09:46 AM) Mac User: ooh....pretty....gimmicks.....
(09:10:08 AM) Linux User: Oh, is there an equivalent of workspaces in MacOS?
(09:10:17 AM) Mac User: in Leopard, yeah
(09:10:24 AM) Linux User: That's this next version, right?
(09:10:30 AM) Mac User: yizzur
(09:10:34 AM) Linux User: Awesome.
(09:10:43 AM) Mac User: "Spaces"
(09:10:49 AM) Linux User: Lol.
(09:10:59 AM) Linux User: We Linux folk have had that for years.
(09:11:00 AM) Mac User: http://www.apple.com/macosx/leopard/spaces.html
(09:11:01 AM) Linux User: But anyways.
(09:11:15 AM) Mac User: again....I don't care, and you're the only one who noticed
(09:11:34 AM) Linux User: LOL. Awesome argument. :x
(09:11:43 AM) Mac User: I don't argue anymore
(09:12:03 AM) Mac User: If you've bigoted yourself into using PC
(09:12:10 AM) Mac User: s, thats ur own fault
(09:12:44 AM) Linux User: Well, if I can't "uninstall MacOS" - or heaven forbid, order it without MacOS, like I can order most PCs without any OS, for a significant price reduction...
(09:12:49 AM) Linux User: It's not worth getting a Dell.
(09:12:52 AM) Linux User: Or any "PC".
(09:13:02 AM) Linux User: Or an Apple, for that matter.
(09:13:08 AM) Linux User: Dell, I can do that with, though.
(09:13:17 AM) Linux User: I share your Microsuck hatred.
(09:13:18 AM) Linux User: I really do.
(09:13:23 AM) Mac User: you make that sound like a feature
(09:13:24 AM) Linux User: But I also hate MacOS with a passion.
(09:13:32 AM) Mac User: for no reason
(09:13:37 AM) Linux User: No, for full reason.
(09:13:42 AM) Mac User: there's 2 sides of the fight, dude
(09:13:46 AM) Linux User: It's a *nix OS, without all the good stuff.
(09:13:48 AM) Mac User: Apple, and mico$ith
(09:13:57 AM) Linux User: Then there's Linux. ;D
(09:14:05 AM) Linux User: We're not part of the fight, we've already won.
(09:14:06 AM) Mac User: you're out in the woods trying to be a nonconformist
(09:14:22 AM) Linux User: Not at all, actually, I started using Linux because most of my friends were.
(09:14:23 AM) Linux User: :/
(09:14:28 AM) Mac User: yeah, 2% market share. WOO HOO!!!!
(09:14:36 AM) Linux User: 55% of the server share. :/
(09:14:48 AM) Linux User: I think it's above 60, actually?
(09:14:58 AM) Mac User: http://www.apple.com/server/macosx/
(09:15:01 AM) Mac User: > you
(09:15:16 AM) Linux User: Why, exactly, would I run MacOS as a server? When I have Linux?
(09:15:23 AM) Linux User: You don't have a package manager (apt)
(09:15:40 AM) Linux User: apt-get install apache2 php mysql
(09:15:42 AM) Linux User: Done.
(09:15:48 AM) Mac User: you wouldn't
(09:15:58 AM) Mac User: and that's your business
(09:16:04 AM) Mac User: why are you talking to me again?
(09:16:20 AM) Mac User has signed off.

And that was him blocking me. Mac people really do think differently.

0 Replies

Replies are automatically detected from social media, including Twitter, Facebook, and Google+. To add a comment, include a direct link to this post in your message and it'll show up here within a few minutes.