On the Internet, the limited query-processing capabilities of sources make answering even the simplest queries challenging. In this paper, we present a scheme called GenCompact for generating capability-sensitive plans for queries on Internet sources. The query plans generated by GenCompact have the followingadvantages over those generated by existing query-processing systems: (1) the sources are guaranteedto support the query plans; (2) the planstake advantage of the source capabilities; and (3) the plans are more efficient since a larger space of plans is examined.