jsfenfen / 990-xml-database

Django app to consume and store 990 data and metadata
BSD 2-Clause "Simplified" License
23 stars 16 forks source link

Optimize filing_filing table definition #4

Closed cschnaars closed 6 years ago

cschnaars commented 6 years ago

Best I can tell, the filing_filing table is not automatically generated and could be optimized to get rid of unused columns and trim variable-length character fields. My findings are based only on looking at 1.6 million filings from 2014 through early 2018, so it's possible larger fields were used in the past or should be left in place to allow for future growth. Also, many fields should be non-nullable.

jsfenfen commented 6 years ago

Good points, I'm not super concerned about field size for varchars postgres is pretty efficient. This is one of the smaller tables in the db, optimizing this and then loading 10 gigs on other tables seems not incredibly useful. Closing and reopening the relevant bits.

jsfenfen commented 6 years ago

Also @cschnaars: filing_filing should be created by a migration. You might need to generate and run that. That should be step 1 here.

jsfenfen commented 6 years ago

Split into #5 #6 and #7