webdevcody / wdc-saas-starter-kit

https://wdcstarterkit.com/
MIT License
859 stars 219 forks source link

Add indexes to commonly queried fields #16

Open camwebby opened 1 month ago

camwebby commented 1 month ago

@webdevcody Hey!

Idea: We should add indexes to table fields that are commonly queried on, and do not already have a unique, primary or composite index. This will allow for more scalable queries. It may also prompt people to think about indexing when they inspect and use the starter kit.

Scope: I think adding indexes especially where there will be an enduring need for the field query regardless of how the "forkee" adapts the starter kit, will make the most sense to start. Examples of this might include:

Before adding these in, it would be good to conduct a brief analysis to identify fields where this does make sense, as well as identify fields that while are queried on, it might not make sense to apply an index.

What do you think? I would be happy to do that analysis and then submit a PR you agree it makes sense.

P.s. Needless to say – thank you for setting up this starter kit and your hard work! 

webdevcody commented 1 month ago

I think it would be useful. I don't think I invested too much time looking into performance. I'd merge it if you work on it!