qwat-data-model icon indicating copy to clipboard operation
qwat-data-model copied to clipboard

Considering changing all the fk_columns from integer to smallint but also take into account reordering the columns

Open tudorbarascu opened this issue 4 years ago • 3 comments

Basically, we shouldn't have any fk_column as integer as smallint is enough, thus keeping two small columns in the same 4k page (default of postgres) and improving performance, index size etc.

https://medium.com/braintree-product-technology/postgresql-at-scale-saving-space-basically-for-free-d94483d9ed9a

tudorbarascu avatar Oct 01 '20 19:10 tudorbarascu

@tudorbarascu yup, would be nice. Do you reach large enough database to feel such optimizations are necessary in your cases?

haubourg avatar Oct 02 '20 08:10 haubourg

@tudorbarascu do you encounter size or latency issues with QWAT?

The technical idea seems good to me, I would assume that only materials would be possible to reach over the 32767 limit smallint (and now still far from it).

ponceta avatar Nov 05 '20 08:11 ponceta

@ponceta @haubourg The project is working well for now as we all fixed most of whatever issues I had over the years. However, I always considered that we should do the basics really well as the little performance hits propagate on the long run. For now, the biggest pain point is the attribute table performance for lots of features but this concerns the whole QGIS platform, not just QWAT/QGEP.

tudorbarascu avatar Nov 06 '20 09:11 tudorbarascu