Re: Query - CPU issue - Mailing list pgsql-general

From Jayadevan
Subject Re: Query - CPU issue
Date
Msg-id 1379560692965-5771552.post@n5.nabble.com
Whole thread Raw
In response to Re: Query - CPU issue  (Kevin Grittner <kgrittn@ymail.com>)
Responses Re: Query - CPU issue  (Kevin Grittner <kgrittn@ymail.com>)
List pgsql-general
Kevin Grittner-5 wrote
> What is the longest you have let it run, in hours or minutes?

I let it run for about 10 minutes and killed it.

Kevin Grittner-5 wrote
> By the way, IMMUTABLE has to be wrong here, since the results
> depend on the state of the database.  STABLE is likely the right
> designation.

The data will not change unless I do a reload of the data set manually. In
that case, is IMMUTABLE wrong?
Here is the EXPLAIN (no analyze)
explain
select  distinct geoip_city(src_ip) , src_ip
from alert where timestamp>=1378512000 and timestamp < 1378598400;
                                         QUERY PLAN
---------------------------------------------------------------------------------------------
 Unique  (cost=3815.75..3894.61 rows=39 width=8)
   ->  Sort  (cost=3815.75..3842.04 rows=10515 width=8)
         Sort Key: (geoip_city(src_ip)), src_ip
         ->  Index Scan using idx_alert_ts on alert  (cost=0.29..3113.34
rows=10515 width=8)
               Index Cond: (("timestamp" >= 1378512000) AND ("timestamp" <
1378598400))
(5 rows)





--
View this message in context: http://postgresql.1045698.n5.nabble.com/Query-CPU-issue-tp5771421p5771552.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


pgsql-general by date:

Previous
From: CR Lender
Date:
Subject: Re: How to know if a query is semantically correct without execute it?
Next
From: Kevin Grittner
Date:
Subject: Re: Query - CPU issue