RFC 33: Removing msLayerWhichItems()...

Steve Lime Steve.Lime at DNR.STATE.MN.US
Tue Jul 10 16:59:10 EDT 2007


The performance concern is real although I don't know how big a deal it is for all drivers. I
believe with shapefiles you get everything anyway. Not sure about others. How would OGR
be impacted?

msLayerWhichItems sets up the item indexes and you still need that for queries since CLASSes
come into play.

I think one point of caching is that you'd want to use the cache for multiple purposes including
output. So it would be nice to treat a shapeObj the same in any context. I mean, let's say you
have a cache and you want to use a different label attribute. It would defeat the purpose to 
have to throw away everything and repopulate.

One way to mitigate the performance impact might be to allow a user to explicitly set the ITEMS 
array in the configuration file. I'm hoping that with PostGIS and Oracle Spatial that's essentially 
what you do with the sub-selects. An added benefit of that would be that inline features could
now have attributes:

LAYER
  NAME 'anInlineLayer'
  TYPE POLYGON
  STATUS OFF
  ITEMS name, type, area END
  LABELITEM 'name'
  FEATURE
     POINTS ... END
     VALUES 'St. Paul', 'CITY', '53045098.12' END
  END
  ...
END

or something like that... If someone screwed up an error would be thrown a bit later in processing
than now, when the attribute is first referenced (e.g. classification or labeling).

Steve


>>
> On 7/10/2007 at 12:47 PM, in message <4693C614.8010008 at mapgears.com>, Daniel
Morissette <dmorissette at MAPGEARS.COM> wrote:
> Steve Lime wrote:
>> Hi all: I tried to put some thoughts down regarding removing 
> msLayerWhichItems() from maplayer.c. This sets us up for feature caching, 
> both using Tamas' nested layers and for single pass query support using the 
> resultCacheMemberObj.
>> 
>> Please see: http://mapserver.gis.umn.edu/development/rfc/ms-rfc-33 
>> 
> 
> If I got this right, this would mean that we would always read all 
> attributes for all shapes in a layer whether we need them or not. This 
> could have a peformance impact for rendering layers with a large number 
> of attributes.
> 
> It seems that only queries need to read all the attributes but when 
> rendering there is no reason to read them all unless we are doing 
> caching or RFC-22a kind of stuff, right?
> 
> Could we not instead just provide a mechanism to skip msLayerWhichItems 
> (or ignore its results) when doing a query or caching?
> 
> Feel free to tell me to shut up as I may not fully understand the impact 
> of what I'm suggesting.
> 
> Daniel



More information about the mapserver-dev mailing list