Spring Data JPA | Query Hints | Optimize Database Performance | Hands-On Guide

Поділитися
Вставка
  • Опубліковано 17 січ 2025

КОМЕНТАРІ • 71

  • @MohamedKaanoun
    @MohamedKaanoun Місяць тому +16

    Bro deserves 100M subscribers

    • @Javatechie
      @Javatechie  Місяць тому +11

      I don't know the true buddy whether i could reach even 1M or not however This word is enough for me to boost 🥰

    • @reshmasoni7671
      @reshmasoni7671 Місяць тому +1

      I think gold button from UA-cam ❤❤❤

    • @richardvincent3979
      @richardvincent3979 Місяць тому +2

      Not 100M please, 1Billion. Your information are always relevant. Thank you for consistently delivering value. You are the best

    • @Javatechie
      @Javatechie  Місяць тому +3

      Thank you Richa for your good wishes 🥰. Keep learning 😊

    • @subhbirajdar
      @subhbirajdar Місяць тому +2

      Interesting video for db performance

  • @goodcourseavailable
    @goodcourseavailable Місяць тому +7

    Amazing tutor on UA-cam..
    1M subscribers soon 🎉

    • @Javatechie
      @Javatechie  Місяць тому +1

      Thank you so much buddy for your kind words 😊. Keep learning 😊

  • @manishkeshari5096
    @manishkeshari5096 29 днів тому +4

    East or West, Java Techie is the best ❤

  • @rameshbabub5243
    @rameshbabub5243 Місяць тому +2

    I didn't know we can do this, thanks for this tutorial

  • @ravindrakushwahakrishna
    @ravindrakushwahakrishna Місяць тому +3

    Thanks sir for everything

  • @ravirajsaraganachari3038
    @ravirajsaraganachari3038 11 днів тому +1

    I request you to continue the same as it will help many in building their careers. Wishing you great success and may God bless you for your incredible efforts, sir. ❤

  • @KenanSevinmedik-u5f
    @KenanSevinmedik-u5f Місяць тому +1

    Thank you brother. I love Java Techie!

  • @tufankarmakar4497
    @tufankarmakar4497 Місяць тому +1

    Thanks for sharing such a usefull video

  • @skaftab3954
    @skaftab3954 Місяць тому +1

    Bro these are premium stuff. I am surprised by the number of subscribers.

  • @erbharat2022
    @erbharat2022 Місяць тому +1

    Thank you 🙏🏻

  • @Rakeshcp-g7w
    @Rakeshcp-g7w Місяць тому +1

    Thanks for sharing 👍

  • @VikashRai_07
    @VikashRai_07 Місяць тому +1

    Thanks! 🙂

  • @anandnigade5886
    @anandnigade5886 Місяць тому +1

    I was also searching for the same. Thank you so much 🎉

  • @GKK31
    @GKK31 Місяць тому +1

    Thanks for sharing

  • @satyamsundaram-r4n
    @satyamsundaram-r4n Місяць тому +1

    Thanks❤🙏

  • @henrivalencia21
    @henrivalencia21 Місяць тому +1

    thank you.

  • @ALLinONE121
    @ALLinONE121 Місяць тому +1

    Great 👍

  • @siyamuddin
    @siyamuddin Місяць тому +1

    Impressive

  • @girishputtaraju8581
    @girishputtaraju8581 21 день тому +1

    Hello Basat, Please make video for gRPC synchronous communication

  • @karthikravisankar5608
    @karthikravisankar5608 Місяць тому +1

    Could you please post a video on the jpa specification interface

  • @shubhamthakare1599
    @shubhamthakare1599 Місяць тому +1

    please explain about Optimistic vs. Pessimistic Locking in Spring Data and thank you for this video

    • @Javatechie
      @Javatechie  Місяць тому

      Sure good suggestion 👍. Noted ✅️

    • @joshipratik3381
      @joshipratik3381 Місяць тому +1

      ​@@Javatechie, Thanking you in anticipation.

  • @vikrambaliga7241
    @vikrambaliga7241 Місяць тому +4

    How long does the value stay in cache,also why did time out if time out was set to 2000, when the response 1029

    • @tubemekala
      @tubemekala Місяць тому

      I also have same question why did time out if time out was set to 2000, when the response 1029?

    • @Javatechie
      @Javatechie  Місяць тому +1

      Guys, that's exactly what I mentioned. The response time may vary. For example, the first time I tried, it took over 2000 ms. However, after a restart, it took only 1029 ms on the second attempt. If you restart and retry again, the response time could exceed 2000 ms or drop below 1029 ms

    • @Javatechie
      @Javatechie  Місяць тому +2

      If no explicit cache duration is configured in your cache provider, the cache entries will remain until they are evicted due to memory constraints, manual eviction, or application restart.

    • @vikrambaliga7241
      @vikrambaliga7241 Місяць тому +1

      @@Javatechie Thanks Sir

  • @azharmobeen
    @azharmobeen 13 днів тому +1

    Thanks for sharing but in Spring data jpa we have @Transactional(readOnly = true) and similary we have paggination as well. why we need to use QueryHint ? what's the main advantage ?

    • @Javatechie
      @Javatechie  13 днів тому

      Transaction ment to avoid data inconsistency buddy however Query hints will help to boost your query performance on the fly applying inbuilt support on query itself

  • @vndprasadgrandhi4344
    @vndprasadgrandhi4344 Місяць тому

    Thank you very much sharing information bro..Plz plan java 9 to java11 series from your way and Waiting lot of persons same

  • @praveenkchowdam
    @praveenkchowdam 23 дні тому +1

    Hello bro . Your explanation is good . one request from my end. please create one springboot +react (crud application) with all the features like api gateway and spring security ,kafka , redis cache , postgres db . I already requested so many times in the comments . please make one video on that , it will be helpful for others also.

  • @weitanglau
    @weitanglau Місяць тому +1

    Can you make a Spring Data JDBC video?
    Simpler than JPA

    • @Javatechie
      @Javatechie  Місяць тому +1

      Okay sure will do that

  • @Anilkumar-reddy
    @Anilkumar-reddy Місяць тому +1

    Good Video as always♥, one doubt here. In video iu mentioned in the quertHint annotatios as fetch size is 50 right. after calling the api, did u get the records in 1lakh++ or only 50

    • @Javatechie
      @Javatechie  Місяць тому

      No let me clear your doubts , fetchSize controls how many rows the JDBC driver fetches in one go from the database cursor but doesn’t limit the total records returned by the query. For example, with fetchSize=50, the driver fetches rows in chunks of 50, optimizing memory usage for large datasets. However, all rows matching the query will still be returned unless explicitly limited using setMaxResults() or a LIMIT clause. For instance, if a query matches 1000 rows, they’ll be fetched in 20 chunks of 50 but all 1000 rows will be returned unless otherwise restricted.
      Hope this make sense

    • @Anilkumar-reddy
      @Anilkumar-reddy Місяць тому +1

      @ Thank you for detail explaination👌👌🙌

  • @veerraju8445
    @veerraju8445 8 днів тому

    using query hints,page size was set to 50 but in response we got all records?

  • @girishvm2335
    @girishvm2335 Місяць тому

    Timeout is not required right technically
    Let it take the actual time as we optimised the method using queryhint know .

  • @girishrp9339
    @girishrp9339 Місяць тому +1

    Basat request you please answer this question
    Why introduced Java 8 static and default method in interface and abstract class already used it?
    Can you tell me real time example

    • @Javatechie
      @Javatechie  Місяць тому

      Girish i have covered this video on my interview QA series please have a look once , after watching if you are unclear then please feel free to let me know

  • @ash-1908
    @ash-1908 Місяць тому +1

    When we use Queryhint for saving query response to cache, if the data in database is always changing, how will it help ? Because the cache data will not be in sync if database data is changed right ?

    • @Javatechie
      @Javatechie  Місяць тому +1

      It will update once you try fetching the records . Not sure how it does will check and update buddy

  • @girishrp9339
    @girishrp9339 Місяць тому +1

    Can do make video of jpa save performance. In real time am facing 15sec to save into 3tables using oneTOMany relationship with Eager loading

    • @Javatechie
      @Javatechie  Місяць тому

      Okay sure I will plan but can you elaborate your usecase what is the payload size you are persisting to DB is this in bulk or single nested payload ?

    • @girishrp9339
      @girishrp9339 Місяць тому +1

      iterating one record at time
      hearder table 1 record
      Details table 3 records
      Under details child table 4 records
      3 tables one-to-many relationship
      Please make eager and lazy loading I didn't understand others videos still confused when to use fetchType.Eager and Lazy. One interview asked didn't given proper example

    • @Javatechie
      @Javatechie  Місяць тому

      @@girishrp9339 thanks for clear picture let me try to reproduce this exact scenario and will update you buddy

  • @XprimeX-q7l
    @XprimeX-q7l Місяць тому +1

    hey the fetched size was 50 but it bought 196504 records how? and where was cache?

    • @Javatechie
      @Javatechie  Місяць тому

      No what it does is , fetchSize controls how many rows the JDBC driver fetches in one go from the database cursor but doesn’t limit the total records returned by the query. For example, with fetchSize=50, the driver fetches rows in chunks of 50, optimizing memory usage for large datasets. However, all rows matching the query will still be returned unless explicitly limited using setMaxResults() or a LIMIT clause. For instance, if a query matches 1000 rows, they’ll be fetched in 20 chunks of 50 but all 1000 rows will be returned unless otherwise restricted.

  • @rajesh.gundabathula
    @rajesh.gundabathula 26 днів тому

    HI Bro now a days every one discussing about AI and chat gpt will be in future what type of evolution can be happening in java.can we include AI in java for our
    daily work

  • @karthiksundaram544
    @karthiksundaram544 Місяць тому +1

    🎉

  • @RohitSingh-sd2hn
    @RohitSingh-sd2hn Місяць тому

    i couldn't find your design pattern playlist, can you please post that playlist link.

    • @RohitSingh-sd2hn
      @RohitSingh-sd2hn Місяць тому +1

      finally can i get rid of redis cache ?

    • @Javatechie
      @Javatechie  Місяць тому

      Redis complete Playlist is there buddy just click on Playlist section of javatechie you will find everything . Do let me know incase still you are facing issues

  • @akhill357
    @akhill357 Місяць тому +1

    Where's pagination implemented here, you got all records at once

    • @Javatechie
      @Javatechie  Місяць тому

      FetchSize will load chunk of records on batch on the fly buddy. That's what the magic

  • @thurlukulasekhar223
    @thurlukulasekhar223 Місяць тому +1

    Small doute if it taken 1029 but why it thorws exception 2000 limit time

    • @Javatechie
      @Javatechie  Місяць тому

      When first time I ran it might took more than 2 sec that's why we get error. Second time it took only 1029 ms
      So the fact is that it will varry , for example if i will run 5 times in my local every time it won't give you the same result buddy

  • @yashwanthv1092
    @yashwanthv1092 Місяць тому +1

    Great content from you as usual. Thanks a ton. Can you make a video on how to optimise update, delete and insert queries.

  • @2RAJ21
    @2RAJ21 28 днів тому

    Thank you