Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50109 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61595 invoked from network); 6 Nov 2010 02:09:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Nov 2010 02:09:41 -0000 Authentication-Results: pb1.pair.com header.from=ssufficool@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=ssufficool@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: ssufficool@gmail.com X-Host-Fingerprint: 209.85.216.42 mail-qw0-f42.google.com Received: from [209.85.216.42] ([209.85.216.42:56281] helo=mail-qw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 19/A8-03924-4E8B4DC4 for ; Fri, 05 Nov 2010 21:09:41 -0500 Received: by qwj8 with SMTP id 8so3187653qwj.29 for ; Fri, 05 Nov 2010 19:09:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=dj+jSU6FRnYkFPjdX4U3nnF+Hd0zDavzQTNUTiRoG8k=; b=tASWEH6vP40GQKD2nIE8gVURyjBuCz++wCGYGJ30CKmbidS9eeyG6o0KjgS9IkwtIp vLrz9A6X84OUaBYD+k4n5uT39VJcm9389ewpNUrWs3GtgSOVgO1m3CbonFf/+4+RbqbV wCtDpIl1ngJOUSMIdU6Yt8Q0IYob6hcddd82s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=rp96obQ3VgeF3gLrOFvhD26fwdz218IDG6R+DlnOfyj9rZt6aSbxaIxxEjYP9h7oQB GpHvE2haOunSC8nDIXqZ5+ke1urbyU2xaQeZiwzAZ3caAImD3fE/Bh5U18WJcvAxXCHI wGFW6ABxKXpm+poyygpF6D0pZLi620K5ixvZM= MIME-Version: 1.0 Received: by 10.224.218.74 with SMTP id hp10mr1602998qab.305.1289009375924; Fri, 05 Nov 2010 19:09:35 -0700 (PDT) Received: by 10.220.172.202 with HTTP; Fri, 5 Nov 2010 19:09:35 -0700 (PDT) In-Reply-To: <4CD3C012.5020807@lsces.co.uk> References: <24c7fdf08ac80c097306908d0c4b5512.squirrel@www.l-i-e.com> <4CD3C012.5020807@lsces.co.uk> Date: Fri, 5 Nov 2010 19:09:35 -0700 Message-ID: To: Lester Caine Cc: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] PDO_DBLIB Native PHP Type binding From: ssufficool@gmail.com (Stanley Sufficool) On Fri, Nov 5, 2010 at 1:28 AM, Lester Caine wrote: > Stanley Sufficool wrote: >>> >>> Rule Of Thumb: >>> > =A0If it's a BLOB, and you aren't using it in WHERE or ORDER BY, then= it >>> > =A0doesn't belong in the DB. >>> > =A0Put it in the custom highly-optimized specialized database engine >>> > =A0commonly known as "the file system" where it belongs.:-) >> >> FWIW, large objects cannot be used in ORDER BY in MSSQL, and >> relational integrity is best achieved by having your data in a >> -relational- database. >> >> Think mugshots, digitized signatures, etc. I really do not wish to >> cycle through a record set to do a pass to delete the images on disk >> by filename reference and then run another SQL to delete the records. > > The first brick wall I hit when simply trying to use PDO was this one. On > firebird big text fields are BLOB ( oracle is the same - CLOB ) and I sim= ply > want to read them as strings, but PDO 'optimizes' them as streams. Text > search is best handled IN the database and the content needs to be there = to > search on or create indexes on. So while keeping all the binary content o= n > my websites in the file system is acceptable, doing that with the text is > simply wrong. ( Until perhaps a reach the point when an external text sea= rch > option WOULD be more efficient ;) ) PDO "optimizes" as a stream because PHP may be limited in memory and a full fetch on a large object could be upwards of 2 GB. Regardless of preferences on filesystem vs database storage of LOBs, there are plenty of people using large objects in the database that are suitable for sequential stream access. > > Of cause the character set used for that data is then the next problem an= d > has to be unicode internally since even little things like addresses need= to > be able to accept international users ... I don't have many Chinese/Japan= ese > customers, but the address book can at least handle them :) > > In the database > Rule one ... times are all UTC > Rule two ... text is all unicode Rule three ... expect that rules 1 and 2 won't be followed by whoever designed the database before you and everything will be local specific and varchar. > > I still can't simply switch between the generic firebird driver and the P= DO > one in ADOdb so using PDO is academic at the moment. ADOdb does a GOOD jo= b > of managing the data types and I can switch between most db's with very > little problem ... data wise ... it's always going to be the SQL that is = the > real problem, but with care that can be made reasonably generic as well a= s > long as one bothers to think about that using PDO. Most 'conversions' sim= ply > break what was good cross db sql to 'simplify' things for PDO and then > actually LOOSE access to most other db's :( > > -- > Lester Caine - G8HFL > ----------------------------- > Contact - http://lsces.co.uk/wiki/?page=3Dcontact > L.S.Caine Electronic Services - http://lsces.co.uk > EnquirySolve - http://enquirysolve.com/ > Model Engineers Digital Workshop - http://medw.co.uk// > Firebird - http://www.firebirdsql.org/index.php > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >