Re: refreshRow is slow
От | Oliver Jowett |
---|---|
Тема | Re: refreshRow is slow |
Дата | |
Msg-id | 4B4FB8E6.7040008@opencloud.com обсуждение исходный текст |
Ответ на | Re: refreshRow is slow ("John T. Dow" <john@johntdow.com>) |
Список | pgsql-jdbc |
John T. Dow wrote: > Each row in a postgres database has a unique identifier. I would think that refreshrow could use that to target the specificrow to be refreshed. refreshRow() uses the primary key of the table to synthesize a SELECT to pick out just the one row, yes. If you explicitly select a column called "oid" in your query, it'll use that instead of the PK columns. (I looked at that code and there are a few ways to confuse it. That's why I want to know what the actual query that's causing problems is.) > > I realize that I only want to refresh one row, and that refreshrow actually uses the fetch size and may get more than oneif required. Refreshing many rows using their unique identifiers might not be desirable. Huh? Fetch size should have no effect on refreshRow() - it should only be selecting a single row anyway. Again: What is the actual query being synthesized by refreshRow(), and have you tried analysing that query to work out why it's slow? Also, if you just want to do an UPDATE and have the freshly updated data appear in your resultset, why don't you use the ResultSet update interface? updateRow() populates the ResultSet row with the data sent to the backend as part of the update. -O
В списке pgsql-jdbc по дате отправления: