GoGreen PC TuneUp™
Learn More

this is how we code sign our software and ssl encrypt our websites from our affiliate partner SSL.com


myBlog Home

Back to Blog MTNCOMP


Faster SQL Queries, 3 tips

Published: Monday, October 21, 2019 written by Andy Flagg
View Count: 178
Keywords: SQL Queries, Faster, 3 rules

The following I was just reading online from developer.com news (see below at the link and text below that), and wanted to comment; #1 true, #2 no so sure, #3 sort of makes sense.
For me, my rule of 3 is easier:
1. no more than three indexes per table
2. use strict data typing and strict camel code in SQL queries
more to come...

For building faster SQL queries, follow these hints.

  1. 1. Use Smaller batches

    Always try to delete data or update data in smaller batches. If you try to delete thousands of records in one go, it will impact performance. If you try to update large batches of data in one go, it will also negatively impact performance and speed. Break these up in smaller chunks.

  2. Stop being trigger-happy!

    By using triggers, you may end up locking more than one table at the same time, until the trigger has completed its work. Sometimes a trigger is unavoidable, but only sometimes. Rather, try to split the logic so that only limited resources are locked at a given time.

  3. Avoid nesting views

    As the name implies, nested views are views inside existing views. The more nested a view becomes, the more data has to be returned for a single query and this can really cause your whole database to lag quite quickly. Do not nest views.


if you found this article helpful, consider contributing $10, 20 an Andrew Jackson or so..to the author. more authors coming soon
FYI we use paypal or patreon, patreon has 3x the transaction fees, so we don't, not yet.

© 2020 myBlog™ v1.1 All rights reserved. We count views as reads, so let's not over think it.