Check this :  http://d.hatena.ne.jp/ikasamaH/20080612

On 10 nov, 17:50, Kenchu <[EMAIL PROTECTED]> wrote:
> Let's say I've got a model with a BlobProperty() holding data up to 2
> MB. Take this for example:
>
> class SomeDataFile(db.Model):
>     title = db.StringProperty()
>     data = db.BlobProperty()
>
> Now imagine I'd just want to fetch the title property for the items in
> this model. if I'd query the model, then the datastore would fetch the
> data property for every item. As far as I know, there's no way to ask
> the datastore to select specific fields, making this query extremely
> heavy since each data property would be fetched as well (which might
> be 2 MB / item).
>
> I thought I might solve this by using another table for the actual
> data, and then reference it in the SomeDataFile model as such:
>
> class Data(db.Model):
>     data = db.BlobProperty()
>
> class SomeDataFile(db.Model):
>     title = db.StringProperty()
>     data = db.ReferenceProperty(Data)
>
> But as it turns out, referenced items are included in the result
> making it equally heavy.
>
> One solution might be to do this instead:
>
> class Data(db.Model):
>     data = db.BlobProperty()
>
> class SomeDataFile(db.Model):
>     title = db.StringProperty()
>     data = db.StringProperty()
>
> Where SomeDataFile.data is a string value of the key for the Data
> item. But is that really a good solution?
>
> So the question is:
> How do you NOT fetch a BlobProperty in a model (you want everything
> but the Blob)? How would you model that?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to