pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas Kretschmer <akretschmer@spamfence.net>
To: pgsql-performance@postgresql.org
Subject: Re: Speed up the query
Date: Sun, 1 Dec 2013 08:12:31 +0100
Message-ID: <20131201071231.GA4780@tux> (raw)
In-Reply-To: <B097B80F-2D51-4F42-BC0D-5A38CBCD0C01@gmail.com>
References: <B097B80F-2D51-4F42-BC0D-5A38CBCD0C01@gmail.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Hengky Liwandouw <hengkyliwandouw@gmail.com> wrote:
> 
> But the problem is : when i change the where clause to :
> 
> where jualid is not null or returjualid is not null
> and extract(year from tanggal)='2013')

Try to create this index:

create index xxx on public.tbltransaksi((extract(year from tanggal)))
where jualid is not null or returjualid is not null;

an run the query again, and if this not helps show us explain analyse,
you can use explain.depesz.com to provide us the plan.


Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (15+ messages)  latest in thread

Message-ID: <20131201071231.GA4780@tux>
Permalink:  ../20131201071231.GA4780@tux/
Also on:    postgresql.org/message-id/20131201071231.GA4780@tux

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: akretschmer@spamfence.net
  Subject: Re: Speed up the query
  In-Reply-To: <20131201071231.GA4780@tux>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox