Using LIMIT when querying a single row

mysql_logo

Sometimes you know you are only looking for one row when you are querying your tables. It may be that you are fetching a unique record or checking the existence of any number of records that satisfy your WHERE clause.

Adding LIMIT 1 to your query can increase performance in this situation; – the database engine will stop scanning for records after it finds just one, instead of going through the whole table or index.

For example:

$record = mysql_query(“SELECT username FROM user WHERE country = ‘UK'”);
if (mysql_num_rows($record) > 0) {
// …
}

Can become:

$record = mysql_query(“SELECT username FROM user WHERE country = ‘UK’ LIMIT 1”);
if (mysql_num_rows($record) > 0) {
// …
}

Taskbar Shuffle

For Boolean to recommend a product it has to be pretty good. This is one application that gets installed after each and every Windows reinstall, – and it is especially useful for those of you still using WindowsXP. Boolean is in no way affiliated with the developer, – we just want to share a software gem with you.

Taskbar Shuffle is a simple, small, free utility that lets you drag and drop your Windows taskbar buttons to rearrange them. Here’s a full feature list:

  • Full 32-bit and 64-bit support
  • Reorder your taskbar buttons by dragging and dropping them
  • Reorder your tray icons in the same way
  • Reorder tasks in a grouped button’s popup menu in the same way
  • Middle-click to close programs on your taskbar
  • Works with UltraMon (version 3+ only) taskbars
  • Tweak taskbar button grouping

If you run more than a few applications at a time, you’ll definitely find Taskbar Shuffle useful, so give it a try!

Link to download here

Suversion Cheat sheet

Subversion

A great Subversion cheat sheet is available from http://ariejan.net/

For those of you not yet in the know, Subversion (SVN) is a version control system initiated in 1999 by CollabNet Inc. It is used to maintain current and historical versions of files such as source code, web pages, and documentation. Its goal is to be a mostly-compatible successor to the widely used Concurrent Versions System (CVS).

Get the cheatsheet here

A few other useful links:

Tortise SVN client (Windows only)
Workbench SVN client
Subclipse SVN client
Ankhsvn (Plugin for Visual Studio)
WebSVN (php based repository browser)