Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #32985

Re: Performance JPA

Path csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Cecil Westerhof <Cecil@decebal.nl>
Newsgroups comp.lang.java.programmer
Subject Re: Performance JPA
Date Tue, 03 Nov 2015 19:11:48 +0100
Organization Decebal Computing
Lines 52
Message-ID <87ziyvhs0r.fsf@Equus.decebal.nl> (permalink)
References <87lhagkcsh.fsf@Equus.decebal.nl> <563763d9$0$23727$e4fe514c@news.xs4all.nl> <87d1vrk20x.fsf@Equus.decebal.nl> <n1a51v$4qh$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
Injection-Info mx02.eternal-september.org; posting-host="528adfd6ad074c92fdc6a7f8fb9e23d8"; logging-data="19932"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18awhgynVn3aiI6IlMXeq8rmu4SHt9DK7w="
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:cRcZ9X/JKmElJ3nWfHZjrUm5yw8= sha1:paCM/tO8oWdJ12Z2SxqUVV6A9dE=
X-Homepage http://www.decebal.nl/
Xref csiph.com comp.lang.java.programmer:32985

Show key headers only | View raw


On Tuesday  3 Nov 2015 12:16 CET, Martin Gregorie wrote:

> On Tue, 03 Nov 2015 07:52:46 +0100, Cecil Westerhof wrote:
>
>> At the moment I am told that everything is slower. I am told that a
>> query that took at most 5 seconds now takes one to two minutes. But
>> I asked them to measure the old situation and until now they did
>> not do this. I hope to get today real data about this. But several
>> pages now give a timeout.
>>
> Usually slow retrievals mean that the DBMS is sequentially scanning
> tables rather than using indexes, so the obvious starting point is
> to see how the JPA queries differ from the ones used by JDBC and, if
> the difference can't be found by inspection, to use the DBMS query
> cost analysis facilities to run the queries manually and report
> execution plan used for them.

In principal the JPA should do about the same queries as the JDBC. I
am busy trying to get the logging of the queries at the database side
enabled. I hope I will succeed.

One remark is that I should use the unit test to look which statements
are generated. I have a hard time to convince them that a unit test is
something else as a live run.


> Typically the poor performance is that joins, WHERE or ORDER BY
> clauses on large tables are not supported by indexes: the solution
> is to add these indexes to the schema if the query is run frequently
> enough to justify doing so.
>
> Bad performance can also be the result of poor DB management: most
> DBMS use DB statistics (row counts, etc) as input to the query
> optimiser. If these stats aren't automatically updated by the DBMS
> and the DBA doesn't update them regularly, or turned auto-stats
> update off then the optimiser can do a spectacularly poor job, e.g.
> if stats say a 100,000 table has only 10 rows then most optimisers
> would scan it sequentially because a sequential scan on a table that
> fits in one disk block will always be quicker than indexed access.

But that should go wrong with JDBC and JPA I would think.


> Welcome to the world of RDBMS tuning: I hope your DBA is up to speed
> on this passtime!

I will need ‘some’ skills in convincing I am afraid. :'-(

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-02 09:47 +0100
  Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-02 14:23 +0100
    Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-03 07:52 +0100
      Re: Performance JPA Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-03 11:16 +0000
        Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-03 19:11 +0100
          Re: Performance JPA Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-03 19:15 +0000
            Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-04 09:28 +0100
              Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-10 08:07 +0100
                Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-10 10:35 +0100
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-11 06:20 +0100
                Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-11 09:32 -0500
                Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-10 19:56 -0500
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-11 06:50 +0100
                Re: Performance JPA Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-11 12:17 +0000
                Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-11 09:30 -0500
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-11 23:20 +0100
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-11 23:11 +0100
                Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-11 19:10 -0500
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-12 07:27 +0100
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-13 08:30 +0100
                Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-13 10:45 +0100
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-13 11:06 +0100
                Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-13 13:36 +0100
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-20 09:04 +0100
                Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-13 21:46 -0500
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-20 09:09 +0100
          Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-03 20:35 -0500
            Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-04 09:35 +0100
              Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-07 22:09 -0500
      Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-03 12:29 +0100
        Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-03 19:23 +0100
        Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-03 20:44 -0500
          Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-04 09:48 +0100
          Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-04 10:23 +0100
            Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-04 11:27 +0100
              Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-04 12:42 +0100
                Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-07 22:18 -0500
                Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-09 10:43 +0100
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-20 09:13 +0100
            Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-07 22:12 -0500
              Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-09 10:22 +0100
                Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-10 21:35 -0500
                Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-11 11:29 +0100
      Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-03 20:42 -0500
        Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-04 11:19 +0100
          Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-07 22:05 -0500
  Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-02 20:08 -0500
    Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-03 07:55 +0100
      Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-03 20:45 -0500
  Re: Performance JPA Lew <lewbloch@gmail.com> - 2015-11-16 14:43 -0800

csiph-web