Re: [PERFORM] n_distinct way off, but following a pattern.

2003-11-16 Thread Nick Fankhauser


> It would be interesting to see exactly what inputs are going into this
> equation.  Do you feel like adding some debug printouts into this code?
> Or just looking at the variables with a debugger?  In 7.3 it's about
> line 1060 in src/backend/commands/analyze.c.

Tom-

I don't really have time to follow up at this moment, but I think this would
be interesting to look into, so I'll plan to dig into it over the
Thanksgiving Holiday when I'll have a little time free to follow up on some
fun projects. Your pointers should let me get into it pretty quickly.

In the meantime, I'll just set up a cron job that runs behind my nightly
analyze to put the correct numbers into pg_statistic on the tables that this
affects.

Thanks-
-Nick




---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [PERFORM] Help with count(*)

2003-11-16 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes:
> Tom Lane <[EMAIL PROTECTED]> writes:
>> (I believe the previous discussion also agreed that we wanted to
>> postpone the freezing of now(), which currently also happens at
>> BEGIN rather than the first command after BEGIN.)

> That doesn't make sense to me: from a user's perspective, the "start
> of the transaction" is when the BEGIN is issued, regardless of any
> tricks we may play in the backend.

That's defensible when the user issued the BEGIN himself.  When the
BEGIN is coming from some interface library's autocommit logic, it's
a lot less defensible.  If you consult the archives, you will find
actual user complaints about "why is now() returning a very old time?"
that we traced to use of interface layers that handle "commit()" by
issuing "COMMIT; BEGIN;".

When BEGIN actually is issued by live application logic, I'd expect it
to be followed immediately by some kind of command --- so the user would
be unable to tell the difference in practice.

Hannu moved this thread to -hackers, please follow up there if you want
to discuss it more.

regards, tom lane

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org