On Jul 16, 2011, at 4:14 PM, - - wrote:
> I would like to count rows in q whose mid does not exist in t.
I would write such a query like this:
SELECT COUNT(*)
FROM q
LEFT OUTER JOIN t
ON (t.mid = q.mid)
WHERE t.mid IS NULL;
And I would make sure there was an index on t.mid. (
> - - writes:
> > The weird thing is that before I updated my server the query was about 5
> > times faster.
> > I've googled and I think the problem lies with the under-estimation of the
> > query planner about the number of rows in the nested table.I will be trying
> > the 'set enable_seqsca
2011/7/16 - -
>
> The weird thing is that before I updated my server the query was about 5
> times faster.
>
Updated it from what to what, and how?
--
Mike Nolan
no...@tssi.com
- - writes:
> The weird thing is that before I updated my server the query was about 5
> times faster.
> I've googled and I think the problem lies with the under-estimation of the
> query planner about the number of rows in the nested table.I will be trying
> the 'set enable_seqscan = false' so
On Jul 16, 2011, at 6:32, - - wrote:
The following query seems to take ages despite the EXPLAIN stating that an
index is used.Also, the condition (WHERE t.mid = q.mid) should be a one-to-one
mapping, should it not? In this case the mapping is to 3641527 rows.
Table q has no indexes and not
On Jul 16, 2011, at 6:32, - - wrote:
> The following query seems to take ages despite the EXPLAIN stating that an
> index is used.
> Also, the condition (WHERE t.mid = q.mid) should be a one-to-one mapping,
> should it not? In this case the mapping is to 3641527 rows.
>
> Table q has no inde
The following query seems to take ages despite the EXPLAIN stating that an
index is used.Also, the condition (WHERE t.mid = q.mid) should be a one-to-one
mapping, should it not? In this case the mapping is to 3641527 rows.
Table q has no indexes and not referenced by other tables. Table t has a