Re: Query organization question - Mailing list pgsql-general

From Grzegorz Jaśkiewicz
Subject Re: Query organization question
Date
Msg-id 2f4958ff0904271403l6ce5f87bj5b9fd1c979658db2@mail.gmail.com
Whole thread Raw
In response to Query organization question  ("Gauthier, Dave" <dave.gauthier@intel.com>)
Responses Re: Query organization question
List 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

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: triggers and execute...
Next
From: Richard Broersma
Date:
Subject: Re: triggers and execute...