1. An apparatus comprising: at least one processor; a memory coupled to the at least one processor; a database table residing in the memory; and a cardinality estimator residing in the memory and executed by the at least one processor, the cardinality estimator estimating cardinality of an intermediate dataset that satisfies a query to the database table in a manner that accounts for data skew in the database table.