From: Martijn Tonies Date: January 29 2009 9:09pm Subject: Re: Are dates stored as String? Or Integer? List-Archive: http://lists.mysql.com/mysql/216078 Message-Id: <002a01c98255$e5cba790$1401a8c0@martijnws> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit > Are date columns stored as String or Integer in a MyISAM table? > > I am trying to squeeze more speed from my application and a date column is > used in most of the indexes for my tables. I'm wondering if changing the > Date data type to an Integer is going to speed the queries up. I'm using > Delphi and internally it represents dates as float so using integers will > speed up the Delphi code. But the main slow down I have is with executing > the queries. The dates are used in the indexes, sorting, and in a few > table joins. So is there a speed advantage of switching the dates to > integer? Don't do it! Save yourself the hassle and let MySQL store the dates for you in whatever format it likes. You can use indices to speed up your lookups. When doing a comparison against a value, MySQL probably encodes the written value to it's own internal format, so you lost your "speed" there anyway... With regards, Martijn Tonies Upscene Productions FREE version of Database Workbench Lite for MySQL! http://www.upscene.com Database questions? Check the forum: http://www.databasedevelopmentforum.com