Re: [GENERAL] [PERFORM] Planner making wrong decisions 8.2.4. Insane cost calculations.

2007-08-06 Thread Tom Lane
Henrik Zagerholm <[EMAIL PROTECTED]> writes: > At what point does the planner choose seq scans? When it thinks it's cheaper than the other way. There's no hard and fast answer. The immediate problem you've got is that the estimated size of the tbl_file/tbl_filetype_suffix join is off by a factor

Re: [GENERAL] [PERFORM] Planner making wrong decisions 8.2.4. Insane cost calculations.

2007-08-06 Thread Henrik Zagerholm
6 aug 2007 kl. 17:31 skrev Tom Lane: Henrik Zagerholm <[EMAIL PROTECTED]> writes: WHERE file_indexed IS FALSE AND file_copied IS TRUE AND file_siz

Re: [GENERAL] [PERFORM] Planner making wrong decisions 8.2.4. Insane cost calculations.

2007-08-06 Thread Tom Lane
Henrik Zagerholm <[EMAIL PROTECTED]> writes: > WHERE file_indexed IS FALSE > AND file_copied IS TRUE > AND file_size < (1024) >

Re: [PERFORM] Planner making wrong decisions 8.2.4. Insane cost calculations.

2007-08-06 Thread Gregory Stark
"Henrik Zagerholm" <[EMAIL PROTECTED]> writes: > Ahh, my bad. It is a very small table but I have an unique index. > CREATE UNIQUE INDEX tbl_filetype_suffix_idx ON tbl_filetype_suffix > USING btree (filetype_suffix); Well it can't use that to help with a join. If you had an index on lower(filet

Re: [PERFORM] Planner making wrong decisions 8.2.4. Insane cost calculations.

2007-08-06 Thread Henrik Zagerholm
6 aug 2007 kl. 15:07 skrev Gregory Stark: "Henrik Zagerholm" <[EMAIL PROTECTED]> writes: Hi list, I'm having a weird acting query which simply retrieves some files stored in a db which are related to a specific archive and also has a size lower than 1024 bytes. Explain analyze below. T

Re: [PERFORM] Planner making wrong decisions 8.2.4. Insane cost calculations.

2007-08-06 Thread Gregory Stark
"Henrik Zagerholm" <[EMAIL PROTECTED]> writes: > Hi list, > > I'm having a weird acting query which simply retrieves some files stored in a > db > which are related to a specific archive and also has a size lower than 1024 > bytes. > Explain analyze below. The first one is with seq-scan enabled

[PERFORM] Planner making wrong decisions 8.2.4. Insane cost calculations.

2007-08-06 Thread Henrik Zagerholm
Hi list, I'm having a weird acting query which simply retrieves some files stored in a db which are related to a specific archive and also has a size lower than 1024 bytes. Explain analyze below. The first one is with seq-scan enabled and the other one with seq-scans disabled. The weird thi