[Rets-dev] On bandwidth
Matt Lavallee
matt at pmptechnology.com
Tue May 1 12:52:04 CDT 2007
Also in-line:
[snip: gathering media data at the MLS]
> Unfortunately, on production servers, the introspection is fairly
> expensive. While I agree that this is a useful thing and it possibly
> should go in the standard, we might find that it is not populated in
> many cases. I'll include it, but I suspect that it will be empty in many
> cases.
Certainly it would be empty now (in general), but getting the X,Y dimensions of
photos or including file size is a fairly trivial exercise in any modern
programming language. Again, I think it's a good "nudge", because I'm sure
those that don't already wouldn't mind putting it in.
[snip: querying for thumbnails]
> > Now, of course, this introduces some issue of querying. While XPath
> > could get the smallest thumbnail quite easily, the SQL required to
> > perform the same task is a bit awkward and includes some extended,
> > recursive statements.
> >
> Where were you when XPath was discussed :-)
>
> I'm not sure what your concern with the querying is. Please expand on
> your concern.
Well, the SQL would have to look something like this (highly abridged for
clarity):
SELECT MediaContent FROM Media WHERE MediaID=(SELECT MediaID FROM (SELECT
Thumbnail[0].MediaID FROM Property WHERE ID=12345678)))
... and even that doesn't afford the opportunity to select which thumbnail to
grab (just trying index 0), and isn't proper SQL.
In XPath:
//Properties/Property[@id='12345678']/Media/Thumbnails/Media[@size='small']/Medi
aContent
... and, voila, you have all of the "small" thumbnails for a particular listing.
-Matt
More information about the Rets-dev
mailing list