pgjdbc/pgjdbc GitHub issues and pull requests (mirror)
help / color / mirror / Atom feed[pgjdbc/pgjdbc] PR #3528: Implement performance fix for catalog check in DatabaseMetaData
11+ messages / 3 participants
[nested] [flat]
* [pgjdbc/pgjdbc] PR #3528: Implement performance fix for catalog check in DatabaseMetaData
@ 2025-02-18 20:47 "SophiahHo (@SophiahHo)" <[email protected]>
0 siblings, 0 replies; 11+ messages in thread
From: SophiahHo (@SophiahHo) @ 2025-02-18 20:47 UTC (permalink / raw)
To: pgjdbc/pgjdbc <[email protected]>
Fixes DatabaseMetaData performance issue https://github.com/pgjdbc/pgjdbc/issues/3511
### All Submissions:
* [x] Have you followed the guidelines in our [Contributing](https://github.com/pgjdbc/pgjdbc/blob/master/CONTRIBUTING.md) document?
* [x] Have you checked to ensure there aren't other open [Pull Requests](../../pulls) for the same update/change?
<!-- You can erase any parts of this template not applicable to your Pull Request. -->
### New Feature Submissions:
1. [x] Does your submission pass tests?
2. [x] Does `./gradlew styleCheck` pass ?
3. [ ] Have you added your new test classes to an existing test suite in alphabetical order?
### Changes to Existing Features:
* [ ] Does this break existing behaviour? If so please explain.
* [x] Have you added an explanation of what your changes do and why you'd like us to include them?
* [ ] Have you written new tests for your core changes, as applicable?
* [x] Have you successfully run tests with your changes locally?
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #3528: Implement performance fix for catalog check in DatabaseMetaData
@ 2025-02-19 00:43 ` "davecramer (@davecramer)" <[email protected]>
9 siblings, 0 replies; 11+ messages in thread
From: davecramer (@davecramer) @ 2025-02-19 00:43 UTC (permalink / raw)
To: pgjdbc/pgjdbc <[email protected]>
Did you check to make sure the plan is the same as previously ?
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #3528: Implement performance fix for catalog check in DatabaseMetaData
@ 2025-02-19 14:21 ` "SophiahHo (@SophiahHo)" <[email protected]>
9 siblings, 0 replies; 11+ messages in thread
From: SophiahHo (@SophiahHo) @ 2025-02-19 14:21 UTC (permalink / raw)
To: pgjdbc/pgjdbc <[email protected]>
@davecramer I assume the plan would be different, because I verified that the change drastically improved the performance of `getCrossReference`. With the same arguments and environment, version 42.7.5 took 3835 ms and the new version took 1504 ms.
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #3528: Implement performance fix for catalog check in DatabaseMetaData
@ 2025-02-19 15:22 ` "davecramer (@davecramer)" <[email protected]>
9 siblings, 0 replies; 11+ messages in thread
From: davecramer (@davecramer) @ 2025-02-19 15:22 UTC (permalink / raw)
To: pgjdbc/pgjdbc <[email protected]>
@SophiahHo thanks!
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #3528: Implement performance fix for catalog check in DatabaseMetaData
@ 2025-04-02 14:51 ` "davecramer (@davecramer)" <[email protected]>
9 siblings, 0 replies; 11+ messages in thread
From: davecramer (@davecramer) @ 2025-04-02 14:51 UTC (permalink / raw)
To: pgjdbc/pgjdbc <[email protected]>
@SophiahHo reviewing this as I understand this you are adding `and FALSE` if the catalog isn't equal to the current catalog. Why even run the SQL? We know the ResultSet is going to be empty, we could fabricate an empty ResultSet instead.
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #3528: Implement performance fix for catalog check in DatabaseMetaData
@ 2025-04-03 14:27 ` "SophiahHo (@SophiahHo)" <[email protected]>
9 siblings, 0 replies; 11+ messages in thread
From: SophiahHo (@SophiahHo) @ 2025-04-03 14:27 UTC (permalink / raw)
To: pgjdbc/pgjdbc <[email protected]>
@davecramer [Fabricating an empty ResultSet would be pages and pages long](https://stackoverflow.com/questions/64632584/how-to-return-empty-resultset). Additionally, returning an empty ResultSet would be incorrect behaviour if the database is down, the database user credentials were revoked or changed, etc., which should throw an Exception.
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #3528: Implement performance fix for catalog check in DatabaseMetaData
@ 2025-04-09 18:39 ` "vlsi (@vlsi)" <[email protected]>
9 siblings, 0 replies; 11+ messages in thread
From: vlsi (@vlsi) @ 2025-04-09 18:39 UTC (permalink / raw)
To: pgjdbc/pgjdbc <[email protected]>
I think it should be uncommon for the client code to ask for a list of "procedures in a foreign catalog", so it should be fine to go with `and false` trick.
At the same time, certain cases make it easy to return empty resultset without making a database roundtrip.
@SophiahHo , in some of the cases, we use `org.postgresql.core.BaseStatement#createDriverResultSet(Field[] fields, List<Tuple> tuples)` can create resultset. For instance, `getProcedureColumns` prepares `Field[]` declaration, and then it executes a query.
In that case we could use something like
```java
if (catalog != null && !catalog.equals(...)) {
// Returns empty resultset
((BaseStatement) createMetaDataStatement()).createDriverResultSet(f, v)
}
```
I guess Dave meant something like that. WDYT?
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #3528: Implement performance fix for catalog check in DatabaseMetaData
@ 2025-04-09 19:03 ` "davecramer (@davecramer)" <[email protected]>
9 siblings, 0 replies; 11+ messages in thread
From: davecramer (@davecramer) @ 2025-04-09 19:03 UTC (permalink / raw)
To: pgjdbc/pgjdbc <[email protected]>
@vlsi I already merged #3588
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #3528: Implement performance fix for catalog check in DatabaseMetaData
@ 2025-04-13 08:42 ` "vlsi (@vlsi)" <[email protected]>
9 siblings, 0 replies; 11+ messages in thread
From: vlsi (@vlsi) @ 2025-04-13 08:42 UTC (permalink / raw)
To: pgjdbc/pgjdbc <[email protected]>
Does it mean we should close the current PR then?
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #3528: Implement performance fix for catalog check in DatabaseMetaData
@ 2025-04-13 10:51 ` "davecramer (@davecramer)" <[email protected]>
9 siblings, 0 replies; 11+ messages in thread
From: davecramer (@davecramer) @ 2025-04-13 10:51 UTC (permalink / raw)
To: pgjdbc/pgjdbc <[email protected]>
> Does it mean we should close the current PR then?
Yes, I would think so.
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #3528: Implement performance fix for catalog check in DatabaseMetaData
@ 2025-04-14 14:46 ` "davecramer (@davecramer)" <[email protected]>
9 siblings, 0 replies; 11+ messages in thread
From: davecramer (@davecramer) @ 2025-04-14 14:46 UTC (permalink / raw)
To: pgjdbc/pgjdbc <[email protected]>
Closed in favour of #3588
^ permalink raw reply [nested|flat] 11+ messages in thread
end of thread, other threads:[~2025-04-14 14:46 UTC | newest]
Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-02-18 20:47 [pgjdbc/pgjdbc] PR #3528: Implement performance fix for catalog check in DatabaseMetaData "SophiahHo (@SophiahHo)" <[email protected]>
2025-02-19 00:43 ` "davecramer (@davecramer)" <[email protected]>
2025-02-19 14:21 ` "SophiahHo (@SophiahHo)" <[email protected]>
2025-02-19 15:22 ` "davecramer (@davecramer)" <[email protected]>
2025-04-02 14:51 ` "davecramer (@davecramer)" <[email protected]>
2025-04-03 14:27 ` "SophiahHo (@SophiahHo)" <[email protected]>
2025-04-09 18:39 ` "vlsi (@vlsi)" <[email protected]>
2025-04-09 19:03 ` "davecramer (@davecramer)" <[email protected]>
2025-04-13 08:42 ` "vlsi (@vlsi)" <[email protected]>
2025-04-13 10:51 ` "davecramer (@davecramer)" <[email protected]>
2025-04-14 14:46 ` "davecramer (@davecramer)" <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox