PGMapCSS is a library for PostgreSQL/PostGIS which works between an osm2pgsql based database and Mapnik (and maybe other renderers). It processes database (usually OpenStreetMap) objects according to MapCSS rules and calculates resulting colors, widths and other properties for Symbolizers, even geometric modifications.
When not needing geometry/meta data (e.g. when doing relationship queries), do not load geometry/meta data. Add function which loads geometry/meta data later, when requested.
When not needing geometry/meta data (e.g. when doing relationship queries), do not load geometry/meta data. Add function which loads geometry/meta data later, when requested.