Firstly, check that all your columns are actually of the same type and
the indexes are where you say they are. Using \d will show this.
Secondly, if you do the EXPLAIN ANALYZE with "set enable_seqscan=off",
what is the output?
Hope this helps,
On Tue, Nov 09, 2004 at 05:02:01PM -0800, Mike Werthe
I have some more info on my indexing situation, and a new question.
In my previous email, I told about 2 tables: Notification and Item,
which join on a field called ItemID. The joining query didn't execute
as quickly as I thought it should. I now notice that I have another
table, Folder, which jo
> Well, you're joining the entire two tables, so yes, the seq scan might
> be faster.
My mistake. When composing the email to state the problem, I accidentally
gave a wrong versionof the join query.
Here is the corrected version, which still has the sequential scan...
explain select notificat
<[EMAIL PROTECTED]> writes:
> Here is the corrected version, which still has the sequential scan...
> explain select notificationID from NOTIFICATION n, ITEM i where n.itemID
> = i.itemID and i.projectID = 12;
> QUERY PLAN
>
> I'm not a SQL guru by any stretch but would a
> constrained sub-select be appropriate here?
> Well, you're joining the entire two tables, so yes, the seq scan might
> be faster.
My mistake! When composing the email to state the problem, I accidentally
gave a wrong version of the join query.
At 10:11 PM +0100 11/6/04, Pierre-Frédéric Caillaud wrote:
explain select notificationID from NOTIFICATION n, ITEM i where
n.itemID = i.itemID;
QUERY PLAN
--
Hash Join (cost=47162.85..7
explain select notificationID from NOTIFICATION n, ITEM i where
n.itemID = i.itemID;
QUERY PLAN
--
Hash Join (cost=47162.85..76291.32 rows=223672 width=44)
Hash Cond: ("outer".itemid
On Sat, 06 Nov 2004 12:00:02 -0800, Mike Wertheim wrote:
> Does anyone have any suggestions on how to make this query run faster?
Does it help if you decrease the value of random_page_cost? - That value
can be changed run-time, from within psql. If you find that a certain,
lower value helps, you