Silke Trissl <[EMAIL PROTECTED]> writes:
> I found out, that the change of the operator from '~*' to '=' for the
> item.description brought a great boost in performance (425 secs to 1
> sec!), but not in cost (Query plans at the end).
The main problem seems to be bad estimation of the number of
these two queries are not equal. Query1 returns 6 rows, query2 returns 0
rows, because '~*' and '=' operators are not same. BTW when you use '=',
it could use index on "item.description".
On query1, "Seq Scan on item" estimates 1 row, on query2 it estimates
733 rows. IMHO that's why query1 uses
Hi,
I came across a very intriguing thing:
I had to join two tables and in both tables I wanted to restrict the
result set by some (text/varchar) attributes.
Here is an example:
Table "item" # 147 000 entries
Column | Type | Modifiers
---+-