Re: Re: blob versus file
| From: | Andy | Date: | Tue, 02 Jul 2002 04:00:37 +0000 |
| Subject: | Re: Re: blob versus file | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-104828@lists.php.net to get a copy of this message | ||
i also noticed that the images are not cached at all. The other images
comming from the FS are cached just fine. Do u think thats because of the
blob?
Andy
"Mark" <maggelet@mminternet.com> schrieb im Newsbeitrag
news:20020702034909.033F5559CA@mail.mminternet.com...
On Mon, 1 Jul 2002 14:20:30 +0200, Pierre-Alain Joye wrote:
>On Mon, 1 Jul 2002 14:17:53 +0200
>"andy" <news.letters@gmx.de> wrote:
>
>>Hi there,
>>
>>I am wondering if anybody has experiance in saving images to blob
>>in mysql.
>>
>>I do save images with 1 K and 4 KB to blob fields while I used to
>>save them
>>to file. It seams to me that this is much slower accessing the
>>files. The
>>images take a bit (really short but absolutly noticable) to show up
>>on the
>>site. Is there a way to improve the performance, and why is this
>>happening?
>>I thought the performance might even boost after storing them to
>>blobs.
>
>Not really, the OS filesystem contains features that makes it always
>faster than a sql query
not necessarily for small files like he's talking about. it depends
on the fs but I would guess they'd be pretty close.
>that will increase your network traffic too.
only if the db is accessed across a network (he didn't say it was)
>Inserting images or whatever binary data in a database does not
have>much sense, you could not do a query with this field, cannot
be>indexed (dunno if exists a DB that implement a image indexer ;) ).
the blob field can't be indexed but others (id, filename, keywords,
caption etc..) can, there's lots of cases where it makes sense to put
images in a database.
if I had to guess the problem I'd say its either
1) the db is across a network like you said
or (more likely)
2) you need to create an index on the table. try running the query
manually and see how long it takes to get a result set. when you get
it down to .01 seconds you;re in good shape
hth,