For speed purposes, we are looking at using the entire SDSS catalog locally with SCAMP, instead of relying on the download from VizieR. While we already have a local copy of the SDSS catalog, direct from Sloan, we are not sure if SCAMP has the necessary spatial searching / database searching abilities to access it without, for example, trying to read an entire region into memory and breaking. Is this exclusively handled in the case of Terapix's CFHT processing by the cdsclient and VizieR, thereby downloading a specific region, or is there functionality in SCAMP's file mode that can handle this?

If not, what would we need to do in order for SCAMP to use it? Write a DBMS that functions like VizieR / cdsclient?

(sorry for the insane delay on answering ) SCAMP's abilities to handle reference catalogue data are pretty limited. cdsclient does manage the cone search and the downloading by default. In ASTREF_CATALOG FILE mode, SCAMP is able to read several binary catalogues in FITS_LDAC format, and to do its own cone search on a union of these catalogues (multiple entries are merged).
Since SCAMP is open source, I would suggest patching the astrefcat.c module to add your own database queries; the code is pretty simple there.
- Emmanuel.