It’s a valid query, but q will run out of memory before returning. You’ll have to add some constraints to the query to reduce the size of the result set. Something like

select from reallybigtable where date = YYYY.MM.DD

would be a good start.