Grokbase
x

Oliver Jowett (o...@opencloud.com)

Profile | Posts (1228)

User Information

Display Name:Oliver Jowett
Partial Email Address:o...@opencloud.com
Posts:
1228 total
3 in PostgreSQL - Admin
45 in PostgreSQL - Bugs
19 in PostgreSQL - General
1188 in PostgreSQL - JDBC
2 in PostgreSQL - Performance
2 in PostgreSQL - SQL

5 Most Recent

All Posts
1) Oliver Jowett Re: [JDBC] Bug? report : PreparedStatement.setObject(java.util.Date) don't work
| +1 vote
Despite the name, java.util.Date actually contains both date and time information, and mapping it...
PostgreSQL - JDBC
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
雨森郷太郎 wrote:

> However, Is there reason to refrain from supporting java.util.Date ?

Despite the name, java.util.Date actually contains both date and time
information, and mapping it to SQL's DATE would silently lose data.
That's why java.sql.Date exists in the first place: it's a deliberately
limited subclass that explicitly only carries date information.

We could map java.util.Date to TIMESTAMP, I suppose, but I think that'll
cause even more confusion since there's also java.sql.Timestamp (that
gives nanosecond precision vs. java.util.Date's millisecond precision).
Most of the time, using java.util.Date with JDBC means you've got an
application bug, and I don't think silently covering it up is a great idea.

-O

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [email protected: majo...@postgresql.org] so that your
message can get through to the mailing list cleanly
2) Oliver Jowett Re: [JDBC] Bug? report : PreparedStatement.setObject(java.util.Date) don't work
| +1 vote
Try using java.sql.Date instead of java.util.Date, there should be a mapping for that. -O...
PostgreSQL - JDBC
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
雨森郷太郎 wrote:

> It seemed org.postgresql.jdbc2.AbstractJdbc2Statement#setObject(int, Object) can't
> map java.util.Date to java.sql.Types#DATE.

Try using java.sql.Date instead of java.util.Date, there should be a
mapping for that.

-O

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate
3) Oliver Jowett Re: [JDBC] Beginning tuning
| +1 vote
BTW, this is because Sun JVM thread dumps and JVMPI/JVMTI generally consider a thread currently in...
PostgreSQL - JDBC
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Phillip Mills wrote:

> (Regarding the main problem, none of my threads are reported in a
> blocked state, leading to my focus on I/O.)

BTW, this is because Sun JVM thread dumps and JVMPI/JVMTI generally
consider a thread currently in a native method to be "running"
regardless of what it's actually doing. In the case of a network read
(implemented as a native method), it's actually most likely to be
blocked in the kernel waiting on more data from the server. Makes for
fun when profiling, I've had to build tools to explicitly exclude "is
probably blocked" native methods from profile results to get anything
useful on systems that are mostly I/O bound :(

-O

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
match
4) Oliver Jowett Re: [JDBC] Beginning tuning
| +1 vote
My guesses would be: the server vs. query rate as a starting point? sync your disks (which in turn...
PostgreSQL - JDBC
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Phillip Mills wrote:

> Since memory problems (other than outright failures) usually present as
> CPU and disk activity, we can eliminate that. It's not CPU, because
> that's where I'm trying to bottleneck and not getting there. So whether
> network or non-network, that leaves I/O. Which is why I started this
> conversation by asking about the I/O routines that I saw on the thread
> stacks.

My guesses would be:

(1) you've run out of disk bandwidth. Have you measured disk I/O rate on
the server vs. query rate as a starting point?

(2) you're hitting your hardware's limit on the rate at which it can
sync your disks (which in turn is related to physical disk access time).
A simple test for that is to turn off fsync (danger, danger, testing
purposes only) and see if that removes the performance cap. Or run off a
purely in-memory filesystem if that's practical for your dataset.

(3) you don't have enough concurrency in your test setup to soak up
query latency. Try more concurrent queries (= more threads in Java land)

All of the above would show up as "JDBC client blocking waiting for the
server to respond".

You'll probably find a more suitable audience on the pgsql-performance
list, though, unless you have something pointing the finger at the JDBC
driver specifically.

-O

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org
5) Oliver Jowett Re: [JDBC] Parsed Query Trees
| +1 vote
No, and the reason is that the JDBC driver doesn't actually parse the query beyond some basic...
PostgreSQL - JDBC
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Kevin Neufeld wrote:
> Does anyone know if a parsed query tree object is exposed in the jdbc
> API? I couldn't find any such thing, nor could I find it in the
> developers roadmap.

No, and the reason is that the JDBC driver doesn't actually parse the
query beyond some basic manipulations to find parameter placeholders and
so on. All the real parsing happens on the server side, and I don't know
of a way to get access to the server's query tree as a client. (It's
debatable how useful that would be, anyway)

-O

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

spacer
Profile | Posts (1228)
Home > People > Oliver Jowett