Re: Query organization question

From: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
To: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Query organization question
Date: 2009-04-27 21:03:51
Message-ID: 2f4958ff0904271403l6ce5f87bj5b9fd1c979658db2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>   exists (select ‘found_it’ from get_jobs(x.name) j where j.job =
> ‘carpenter’);
What does this function do ?
If it only runs on the tables, than simple join will do it pretty fast.
also, keeping job as integer, if table is large will save you some
space, make index lookup faster, and generally make everything faster.
Subselects always perform poor, so please try writing that query as
join first. Postgresql is capable of reordering, and choosing right
approach for query, this isn't mysql - you don't have try to outsmart
db.

--
GJ

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gauthier, Dave 2009-04-27 21:15:05 Re: Query organization question
Previous Message Scott Marlowe 2009-04-27 21:00:37 Re: triggers and execute...