Note that there are some explanatory texts on larger screens.

plurals
  1. POinsert taking too long
    text
    copied!<p>My setup is: JBOSS AS 7.1.1 and PostGreSql</p> <p>When there are no or very less (a couple of hundred) records in the table, my inserts/updates completes very fast. But when the number of records get to a couple of thousand, the inserts or updates take an extremely long time. For ex: inserting a record takes more than 1 or 2 seconds.</p> <p>Not sure where the problem is or where to start.</p> <p>My code to update the database looks like this -</p> <pre><code>public long updateRecord(long id, List&lt;MyData&gt; myDataList) { Event eventFromDB = findById(id).get(0); List&lt;MyData&gt; myDataListFromDB = eventFromDB.getMyData(); for(MyData myData : myDataList) { myDataListFromDB.add(myData); } em.merge(eventFromDB); return myDataList.size(); } </code></pre> <p>I am a newbie and have set up the jboss as to the best of my knowledge.</p> <p>I haven't done any configuration settings on either the JBOSS AS or the PostGreSQL.</p> <p>The JBOSS AS is running in the standalone mode using the standalone-full.xml config file.</p> <p>Thanks in advance.</p> <pre><code>jbossql=# \d event_mydata Table "public.event_mydata" Column | Type | Modifiers -----------------+------------------------+----------- event_id | bigint | not null date_time | character varying(255) | secs_since_1970 | double precision | value | real | Foreign-key constraints: "fkcf2bc134ec016855" FOREIGN KEY (event_id) REFERENCES event(id) </code></pre> <p>And List is an element collection</p> <pre><code>@ElementCollection private List&lt;MyData&gt; myData; public List&lt;MyData&gt; getMyData() { return myData; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload