We describe CodeQuest, a system for querying source code. It combines two previous proposals, namely the use of logic programming and database system. Experiments (on projects ranging from 3KSLOC to 1300KSLOC) confirm that for this application, a query language based on DataLog strikes the right balance between expressiveness and scalability. Categories and Subject Descriptors D.2.6 [Software Engineering]: Programming Environments; H.3.4 [Information Storage and Retrieval]: Systems and Software—source code querying General Terms Languages, Design, Measurement, Performance Keywords Source code querying, analysis of object-oriented programs, DataLog, relational databases