Blog › Categories › Sql | Simon George

PostsCategoriesSql

PostgreSQL count_estimate() function for large tables and views

I once found all admin pages of a web app were taking 100ms longer than they should due to a count query on a huge table. I couldn’t remove the feature but as admins only needed a rough idea of how many rows there were I could substitute an estimate 🔮

Case Insensitive Usernames with PostgreSQL citext

It's polite to refer to people by capitalising the first letter of their name (Joe Blogs). I think web apps should allow capitals in their usernames (JoeBlogs) too.