"Tomas Vondra" writes:
> Could the planner do this reasoning, i.e. see if there's a NOT NULL
> constraint on the column and change the plan accordingly?
Possibly. I'm not sure how expensive it would be. Right now, a
structural change of that sort would have to be done pretty early in
planning,
On 15 Září 2011, 16:26, Tom Lane wrote:
> Yang Zhang writes:
>> On Thu, Sep 15, 2011 at 1:22 AM, Tomas Vondra wrote:
>>> [ use a left join instead of NOT IN ]
>
>> This worked great, thank you. Too bad the planner isn't smart enough
>> to do this yet!
>
> It never will be, because they're not eq
Yang Zhang writes:
> On Thu, Sep 15, 2011 at 1:22 AM, Tomas Vondra wrote:
>> [ use a left join instead of NOT IN ]
> This worked great, thank you. Too bad the planner isn't smart enough
> to do this yet!
It never will be, because they're not equivalent queries. NOT IN has
different (and very
On 15 Září 2011, 11:07, Yang Zhang wrote:
> On Thu, Sep 15, 2011 at 1:22 AM, Tomas Vondra wrote:
>> On 15 Září 2011, 9:53, Yang Zhang wrote:
>>> I have a simple query that's been running for a while, which is fine,
>>> but it seems to be running very slowly, which is a problem:
>>>
>>> mydb=# expl
On Thu, Sep 15, 2011 at 1:22 AM, Tomas Vondra wrote:
> On 15 Září 2011, 9:53, Yang Zhang wrote:
>> I have a simple query that's been running for a while, which is fine,
>> but it seems to be running very slowly, which is a problem:
>>
>> mydb=# explain select user_id from den where user_id not in
On 15/09/11 17:53, Yang Zhang wrote:
I have a simple query that's been running for a while, which is fine,
but it seems to be running very slowly, which is a problem:
mydb=# explain select user_id from den where user_id not in (select
duid from user_mappings) and timestamp between '2009-04-01' a
On 15 Září 2011, 9:53, Yang Zhang wrote:
> I have a simple query that's been running for a while, which is fine,
> but it seems to be running very slowly, which is a problem:
>
> mydb=# explain select user_id from den where user_id not in (select
> duid from user_mappings) and timestamp between '20
On 09/15/11 12:53 AM, Yang Zhang wrote:
mydb=# explain select user_id from den where user_id not in (select
duid from user_mappings) and timestamp between '2009-04-01' and
'2010-04-01';
QUERY PLAN
---
Should also add that while the client is under no load (CPU<1%, load
~0.1, mem ~20%), the server looks pretty busy (CPU 90-100% of 1 core,
load ~1.5, mem ~70-80%), but PG is the only thing using resources.
On Thu, Sep 15, 2011 at 12:58 AM, Yang Zhang wrote:
> If it matters, the client is a JDBC a
If it matters, the client is a JDBC app doing:
con = DriverManager.getConnection("jdbc:postgresql://localhost:5434/mydb",
"yang", password)
con.setAutoCommit(false)
val st = con.prepareStatement("""
select user_id from den where user_id not in (select duid from
user_mappings)
I have a simple query that's been running for a while, which is fine,
but it seems to be running very slowly, which is a problem:
mydb=# explain select user_id from den where user_id not in (select
duid from user_mappings) and timestamp between '2009-04-01' and
'2010-04-01';
QUERY PLAN
11 matches
Mail list logo