Re: [HACKERS] Using Threads?

2000-12-04 Thread Dan Lyke

Adam Haberlach writes:
> Typically (on a well-written OS, at least), the spawning of a thread
> is much cheaper then the creation of a new process (via fork()).

This would be well worth testing on some representative sample
systems.

Within the past year and a half at one of my gigs some coworkers did
tests on various platforms (Irix, Solaris, a few variations of Linux
and *BSDs) and concluded that in fact the threads implementations were
often *slower* than using processes for moving and distributing the
sorts of data that they were playing with.

With copy-on-write and interprocess pipes that are roughly equivalent
to memcpy() speeds it was determined for that application that the
best way to split up tasks was fork()ing and dup().

As always, your mileage will vary, but the one thing that consistently
amazes me on the Un*x like operating systems is that usually the
programmatically simplest way to implement something has been
optimized all to heck.

A lesson that comes hard to those of us who grew up on MS systems.

Dan



[HACKERS] Bug: COUNT() and ExecEvalAggref error

2001-02-21 Thread Dan Lyke

I've looked through my archives of pgsql-general and pgsql-hackers and
haven't seen this, but I do tend to flush the deleted messages
occasionally. I'm trying to get a build off the current CVS tree, but
my working build is from Sunday evening, so I feel moderately current.

Two builds of 7.1beta4 from the CVS tree. The one on my production
machine was built January 29, the one on my development machine was
built from sources gotten Sunday evening.

When I do this:

   $ /usr/local/pgsql/bin/createdb test
   $ /usr/local/pgsql/bin/psql test
   test=# create table abc (id serial, stuff text);
   test=# insert into abc (stuff) values ('xyz');
   test=# insert into abc (stuff) values ('xyz');
   test=# insert into abc (stuff) values ('xyz');
   test=# insert into abc (stuff) values ('qrs');
   test=# insert into abc (stuff) values ('qrs');
   test=# insert into abc (stuff) values ('qrs');
   test=# insert into abc (stuff) values ('qrs');
   test=# insert into abc (stuff) values ('qrs');
   test=# select count(id) from abc;

On my production machine (PosgreSQL built from CVS on January 29) I
get the expected result:

count 
   ---
  8
   (1 row)

On my development machine (Built from CVS late Sunday, February 18), I
get:

   test=# select count(id) from abc;
   ERROR:  ExecEvalAggref: no aggregates in this expression context
   test=# 

Apologies if this has gone by already, I'm in the process of trying to
get an absolutely current CVS update to build and if anyone's got
suggestions on where to start before I dive into the PostgreSQL code
whole hog for the first time I'd sure appreciate it.

Don't think it matters, but just in case, development box is:

  Linux wynand 2.2.17 #7 Wed Nov 8 09:47:05 PST 2000 i586 unknown

Production server, and the machine that the production server binaries
were built on, both of which work:

  Linux mail 2.2.12 #6 Tue Jan 18 17:49:47 PST 2000 i586 unknown
  Linux francon 2.2.18 #2 SMP Sun Jan 28 20:10:18 PST 2001 i686 unknown

All using libc-2.1.3.so

Dan