Re: Migrate from MySQL to PostgreSQL

From: Date: Fri, 23 Jan 2004 14:15:17 +0000
Subject: Re: Migrate from MySQL to PostgreSQL
References: 1 2 3 4 5 6  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-10328@lists.php.net to get a copy of this message
Hi! > 1) Not using DATE, TIME and TIMESTAMP fields makes you miss functions > related to does time fields. No. For me its nicer to do: $timestamp = time(); SELECT col,timestamp FROM table WHERE timestamp > ".$timestamp."... or $timestamp = mktime...; or $timestamp = time()+60*60*24*3; ... Thats nice and fast, I get back a nice unix-timestamp, which I can use like echo date('m-d-Y', $row->timestamp); ... I know date/time functions of mysql, but I don't like using them. For my application the portability is a very important, "mast-have" feature. > 2) If you use a boolean you can have faster selects like this one: > > SELECT * FROM tabname WHERE boolfield That's right, but how many msecs do you save? Querys like that are allways _very_ fast, also if I use tinyint, speed problems are in other querys of large tables, with many colums, and there I usualy have WHERE conditions as "WHERE ID=123", or "WHERE username='foo'"... > This is optimized in the database server, and it should be faster > then having a TINYINT(1) with an index on it (bad MySQL > implementation of boolean data type). That's right, but I don't think that thes speeds up an application noticable. And on the other hand I give up portability or habe to emulate things. For me the advantages of using something like that is not big enough. Not in generel, but in my application I develop at the moment, which needs do be portable as mentioned above. regards Andreas

« previous php.pear.general (#10328) next »