From: Jan Steinman Date: August 10 2011 6:19pm Subject: Re: Query Optimization List-Archive: http://lists.mysql.com/mysql/225515 Message-Id: <3AC0E8EA-E93E-4E19-B3B5-F79F90B82374@Bytesmiths.com> MIME-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable > From: Brandon Phelps >=20 > I am curious if there is any way I can better optimize the below = query, as currently it takes this query around 10 seconds to run but I = am sure this will get slower and slower as the database grows. You need an index on `close_dt`. > SELECT > open_dt, > close_dt, > protocol, > INET_NTOA(src_address) AS src_address, > src_port, > INET_NTOA(dst_address) AS dst_address, > dst_port, > sent, > rcvd > FROM connections > WHERE > dst_port =3D 80 > ORDER BY close_dt DESC > LIMIT 0, 30 ---------------- Current farmers, who have become mere operators of machines and mixers = of chemicals, may not have the skills to develop a local, sustainable = agriculture. A new generation of farmers, numbering in the tens of = millions, will need to be trained and relocated to rural communities. -- = Pat Murphy :::: Jan Steinman, EcoReality Co-op ::::