Re: [PERFORM] Planner incorrectly choosing seq scan over index scan

2005-08-01 Thread Tom Lane
Meetesh Karia <[EMAIL PROTECTED]> writes: > Sure. The lte_user table is just a collection of users. user_id is assigned= > uniquely using a sequence. During some processing, we create a candidates= > table (candidates617004 in our case). This table is usually a temp table.= > sourceid is a user_id

Re: [PERFORM] Planner incorrectly choosing seq scan over index scan

2005-08-01 Thread Meetesh Karia
Thanks John.  I've answered your questions below: Has lte_user and candidates617004 been recently ANALYZEd? All estimates,except for the expected number of rows from lte_user seem to be okay. I ANALYZEd both tables just before putting together my first email.  And, unfortunately, modifying the stat

Re: [PERFORM] Planner incorrectly choosing seq scan over index scan

2005-08-01 Thread Meetesh Karia
Are you referring to the statistics gathering target for ANALYZE?  Based on your email, I just tried the following and then re-ran the explain analyze but got the same "incorrect" plan: alter table candidates617004     alter column sourceId set statistics 1000,     alter column targetId set statis

Re: [PERFORM] Planner incorrectly choosing seq scan over index scan

2005-08-01 Thread John Arbash Meinel
Meetesh Karia wrote: > Hi all, > > We're using 8.0.3 and we're seeing a problem where the planner is > choosing a seq scan and hash join over an index scan. If I set > enable_hashjoin to off, then I get the plan I'm expecting and the query > runs a lot faster. I've also tried lowering the random

Re: [PERFORM] Planner incorrectly choosing seq scan over index scan

2005-08-01 Thread Tobias Brox
[Meetesh Karia - Tue at 12:19:27AM +0200] > We're using 8.0.3 and we're seeing a problem where the planner is choosing a > seq scan and hash join over an index scan. If I set enable_hashjoin to off, > then I get the plan I'm expecting and the query runs a lot faster. I've also > tried lowering t

[PERFORM] Planner incorrectly choosing seq scan over index scan

2005-08-01 Thread Meetesh Karia
Hi all, We're using 8.0.3 and we're seeing a problem where the planner is choosing a seq scan and hash join over an index scan.  If I set enable_hashjoin to off, then I get the plan I'm expecting and the query runs a lot faster.  I've also tried lowering the random page cost (even to 1) but the pl

Re: [PERFORM] Performance problems testing with Spamassassin 3.1.0

2005-08-01 Thread Michael Parker
Jim C. Nasby wrote: >I'm not sure who's responsible for DBI::Pg (Josh?), but would it make >sense to add better support for bytea to DBI::Pg? ISTM there should be a >better way of doing this than adding gobs of \'s. > > It has support for binding a bytea parameter, but in this case we're trying

Re: [PERFORM] Performance problems testing with Spamassassin 3.1.0

2005-08-01 Thread Jim C. Nasby
On Mon, Aug 01, 2005 at 01:28:24PM -0800, Matthew Schumacher wrote: > PFC wrote: > > > > > >> select put_tokens2(1, '{"\\246\\323\\061\\332\\277"}', 1, 1, 1); > > > > > > Try adding more backslashes until it works (seems that you need > > or something). > > Don't DBI convert t

Re: [PERFORM] Performance problems testing with Spamassassin 3.1.0

2005-08-01 Thread Matthew Schumacher
PFC wrote: > > >> select put_tokens2(1, '{"\\246\\323\\061\\332\\277"}', 1, 1, 1); > > > Try adding more backslashes until it works (seems that you need > or something). > Don't DBI convert the language types to postgres quoted forms on its > own ? > Your right I am find

Re: [PERFORM] Performance problems testing with Spamassassin 3.1.0

2005-08-01 Thread PFC
select put_tokens2(1, '{"\\246\\323\\061\\332\\277"}', 1, 1, 1); Try adding more backslashes until it works (seems that you need or something). Don't DBI convert the language types to postgres quoted forms on its own ? ---(end of broadcast)-

Re: [PERFORM] Performance problems testing with Spamassassin 3.1.0

2005-08-01 Thread Matthew Schumacher
Tom Lane wrote: > > Revised insertion procedure: > > > CREATE or replace FUNCTION put_tokens (_id INTEGER, > _tokens BYTEA[], > _spam_count INTEGER, > _ham_count INTEGER, > _at

Re: [PERFORM] [PATCHES] COPY FROM performance improvements

2005-08-01 Thread Alon Goldshuv
Tom, >> I've attached it here, sorry to the list owner for the patch inclusion / >> off-topic. > > This patch appears to reverse out the most recent committed changes in > copy.c. Which changes do you refer to? I thought I accommodated all the recent changes (I recall some changes to the tupleta

Re: [PERFORM] Performance problems testing with Spamassassin 3.1.0

2005-08-01 Thread Matthew Schumacher
Tom Lane wrote: > Michael Parker <[EMAIL PROTECTED]> writes: > >>sub bytea_esc { >> my ($str) = @_; >> my $buf = ""; >> foreach my $char (split(//,$str)) { >>if (ord($char) == 0) { $buf .= "000"; } >>elsif (ord($char) == 39) { $buf .= "047"; } >>elsif (ord($char) == 92) { $b

Re: [PERFORM] [PATCHES] COPY FROM performance improvements

2005-08-01 Thread Tom Lane
"Luke Lonergan" <[EMAIL PROTECTED]> writes: > On 7/29/05 5:37 AM, "Bruce Momjian" wrote: >> Where is the most recent version of the COPY patch? > I've attached it here, sorry to the list owner for the patch inclusion / > off-topic. This patch appears to reverse out the most recent committed chan