Return to site

๐ŸŒ๐Ÿ’š GREEN IT Developer: Limit the number of results

ยท greenIT

When possible, use the ๐‘ณ๐‘ฐ๐‘ด๐‘ฐ๐‘ป statement to specify the number of results to return. This helps minimize the amount of CPU and RAM used to find the relevant records.

The performance improvement will be even greater if the records contain many large fields.

When selecting, if you only want to display the first 25 records of a table containing peopleโ€™s first and last names, replace the following:

๐™Ž๐™€๐™‡๐™€๐˜พ๐™ ๐™›๐™ž๐™ง๐™จ๐™ฉ_๐™ฃ๐™–๐™ข๐™š, ๐™ก๐™–๐™จ๐™ฉ_๐™ฃ๐™–๐™ข๐™š ๐™๐™๐™Š๐™ˆ ๐™ฅ๐™š๐™ค๐™ฅ๐™ก๐™š

with:

๐™Ž๐™€๐™‡๐™€๐˜พ๐™ ๐™›๐™ž๐™ง๐™จ๐™ฉ_๐™ฃ๐™–๐™ข๐™š, ๐™ก๐™–๐™จ๐™ฉ_๐™ฃ๐™–๐™ข๐™š ๐™๐™๐™Š๐™ˆ ๐™ฅ๐™š๐™ค๐™ฅ๐™ก๐™š ๐™‡๐™„๐™ˆ๐™„๐™ 0,25

With SpringBoot/JPA, do pagination ๐Ÿ‘‰ https://lnkd.in/ecz8kkAG

#greenit #developer #resultsetlimit