Segfault-Inc / Multicorn

Data Access Library
https://multicorn.org/
PostgreSQL License
701 stars 145 forks source link

Selecting few cols from a wide database is slow. #160

Closed oscardssmith closed 3 years ago

oscardssmith commented 8 years ago

I am writing a custom fdw that uses a program to pull data from a database. The database has ~30 columns and ~8,000,000 rows. The program accepts filtering based on columns and quals (my fdw passes on both). I am noticing that selecting 1 column of data from the wrapper is 12x slower than from the program it calls, but if I define a different foreign table with only that 1 column, the sql call speeds up 10x. Does anyone have any idea why this would be the case?