java - In SQL optimization, should we always use LIMIT to prevent the system to download a lot of data? Or any other better solution? -


ok, say, there table have million record. somehow need query

select column1 tbl column1 '%a%'; 

suppose result of query used in program checking info, & program need result data checking --> can not take data piecemeal.

if take data piecemeal, have use limit.

but if run query, gonna download lot of data & make system slow down.

question: there other elegant solution?

depending on want data, can ask database (a part of) it. databases can perform lot of operations, adding, subtracting, taking maximum or minimum, averaging, , on.

without knowing exact type of processing, hard tell exact alternatives are, though.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -