How to query tabular data that has thousands of columns
25k columns? Hmm, that smells like some serious denormalisation. Do you have many sets of repeating, numbered columns, perhaps something like purchase_date_1, purchase_date_2, purchase_date_3 ,, purchase_date_99 or value_january, value_february .. value_december? Maybe there are recurring structured blocks such as residential_address, delivery_address, postal_address etc.

The way to handle these is to declare a separate table for each block and put each value in its own row. The above then becomes e.g.

TABLE Purchases
  CSV_row_key
  Purchase_date
  Ordinal      -- to capture the 1..99 if required; probably should be omitted


Transforming columns to rows is sometimes referred to as an unpivot.

Declare indexes on the keys and other predicate columns. Effective indexing is a separate subject for which we'd need the precise table design and the query.

It may be possible to pre-calculate aggregate values from these normalised tables. Running a batch job after loading and writing aggregates to a further set of tables is one approach. Materialized views is another.

1.75 billion values is large but not outrageous by current standards. Any of the usual RDBMSs on reasonable hardware should be able to handle it. Unfortunately the devil is often in the detail. It is possible to defeat the best software with contorted queries and convoluted schema. To avoid that we would need much more specific information.