David,
thank you very much for your reply. It's great to see that all
questions are answered on this list.

> > I understand that the mapper implementation is not optimized.
>
> This is not correct.  The Mapper stuff is fairly well optimized.  It, in
> general, executes 6 times faster than ActiveRecord, running the same queries
> (thus destroying any of Rail's claims about the time being spent in the
> database.)

Good to know.
Now I know that the problem was the amount of queries, not Lift's
handling of SQL.

> I generally write hand-code that pre-fetches.  This generally results in
> significant performance improvements (and 2 or 3 queries per page-load.)

Thanks for the example.
The reason I asked was, that I have two mappers, Blog and BlogEntry.
BlogEntry links to the Blog with an owner field.
If I have lots of BlogEntries and ask every item for the blog it
creates a lot of SQL queries (one for each entry), even if they link
to the same blog. So I thought it would be great to have
something like caching or prefetching build-in so a second query to
the same blog is not necessary any more.

Your example helps to speed this up, but usually I want to work with
the objects itself.
I've build a simple CachedMetaMapper trait for my classes, which
caches findAll and find(Any). Not optimal, but some improvement.

> > - What is a good way to cache queries generated by MetaMapper.find()
> > and findAll() ?
>
> I leave this to the RDBMS.  If you're doing a read-heavy app (like a CMS
> system), I'd manually build a cache in memory... as long as I was sure there
> were no external apps that could update the RDBMS out from under me.

That's what I finally did. Together with manual tuning (e.g. with a
prefetched map) it works very well.

Thank you for your patience and help :)

Joachim

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to