Re: [SQL] Query kill

2002-07-12 Thread Bruce Momjian
I assumed from the user's question that the admin just wanted to stop a specific query of a specific backend. Sending a SIGINT to the backend will do that. I wasn't talking client request or anything like that. Look at the description of the question below. ---

Re: [SQL] Query kill

2002-07-12 Thread Jan Wieck
Bruce Momjian wrote: > > Jan Wieck wrote: > > Bruce Momjian wrote: > > > > > > Rudi Starcevic wrote: > > > > Hello, > > > > > > > > If I write a query that is inefficient or in an eternal loop how > > > > do I stop it without restarting the postmaster ? > > > > > > > > I can see many postmaster p

Re: [SQL] Query kill

2002-07-12 Thread Bruce Momjian
Jan Wieck wrote: > Bruce Momjian wrote: > > > > Rudi Starcevic wrote: > > > Hello, > > > > > > If I write a query that is inefficient or in an eternal loop how > > > do I stop it without restarting the postmaster ? > > > > > > I can see many postmaster processed appearing in the output of the 'ps

Re: [SQL] XML to Postgres conversion

2002-07-12 Thread Marc Spitzer
On Thu, Jul 11, 2002 at 09:23:39AM -0500, [EMAIL PROTECTED] wrote: > Look at contrib/xml at > http://developer.postgresql.org/cvsweb.cgi/pgsql/contrib/xml/. I never > used this, but it might be useful. > > George Essig > > > Hello. > > > > I am trying to figure out how to import xml documents i

Re: [SQL] Query kill

2002-07-12 Thread Jan Wieck
Bruce Momjian wrote: > > Rudi Starcevic wrote: > > Hello, > > > > If I write a query that is inefficient or in an eternal loop how > > do I stop it without restarting the postmaster ? > > > > I can see many postmaster processed appearing in the output of the 'ps' > > command. > > Do I need to sto

Re: [SQL] Query kill

2002-07-12 Thread eric soroos
On Fri, 12 Jul 2002 01:01:31 -0400 (EDT) in message <[EMAIL PROTECTED]>, Bruce Momjian <[EMAIL PROTECTED]> wrote: > Rudi Starcevic wrote: > > Hello, > > > > If I write a query that is inefficient or in an eternal loop how > > do I stop it without restarting the postmaster ? > > > > I can see m

It is a bug in pred_test()! (Was: [SQL] Please, HELP! Why is the query plan so wrong???)

2002-07-12 Thread Dmitry Tkach
Jie Liang wrote: >please copy and paste the whole msg and your query! >Note:what I mean ' join key' is the fields that link two tables. > The message (query plan) is exactly the same (you can see it in the bottom of this message). > >I don't think fb.b=0 is a join key! > Of course not. But it I

Re: [SQL] config postgresql.conf??

2002-07-12 Thread Josh Berkus
Jie, > What parameter I should change in order to make postmaster taking CPU > as > much as > possible? > Maybe I should ask: how can I make big tables equijoin faster? > I have a serveral tables that contain more 2.5 million records, I > need to > equijoin > those tables often. There are severa

[SQL] config postgresql.conf??

2002-07-12 Thread Jie Liang
Hi, What parameter I should change in order to make postmaster taking CPU as much as possible? Maybe I should ask: how can I make big tables equijoin faster? I have a serveral tables that contain more 2.5 million records, I need to equijoin those tables often. Thanks! Jie Liang

Re: [SQL] Please, HELP! Why is the query plan so wrong???

2002-07-12 Thread Jie Liang
please copy and paste the whole msg and your query! Note:what I mean ' join key' is the fields that link two tables. I don't think fb.b=0 is a join key! Jie Liang -Original Message- From: Dmitry Tkach [mailto:[EMAIL PROTECTED]] Sent: Friday, July 12, 2002 7:34 AM To: Jie Liang Cc: [EMA

Re: [SQL] [HACKERS] please help on query

2002-07-12 Thread Luis Alberto Amigo Navarro
Lineitem is being modified on run time, so creating a temp table don't solves my problem The time of creating this table is the same of performing the subselect (or so I think), it could be done creating a new table, and a new trigger, but there are already triggers to calculate lineitem.extendedp

Re: [SQL] rules / triggers on insert. why after?

2002-07-12 Thread Tom Lane
Ahti Legonkov <[EMAIL PROTECTED]> writes: > CREATE TABLE reo ( >"REO_ID" int4 DEFAULT nextval('"REO_ID_seq"'::text) NOT NULL, >"TYPE" varchar(64) NOT NULL, >CONSTRAINT "REO_ID_reo_ukey" UNIQUE ("REO_ID"), >CONSTRAINT reo_pkey PRIMARY KEY ("REO_ID") > ); > CREATE TABLE lreo ( >

Re: [SQL] Please, HELP! Why is the query plan so wrong???

2002-07-12 Thread Dmitry Tkach
Jie Liang wrote: >I believe that SQL will use the index of join 'key' when you join the tables >if >have any, in your query the (a,c) is the join key but d is not. > > >Jie Liang > Not really... I tried this: explain select * from fb joing fbr on (fb.a=fbr.a and fb.c=fbr.c and fbr.d is null) wh

Re: [SQL] SQL problem with aggregate functions.

2002-07-12 Thread Jean-Luc Lachance
What is wrong with: select field_group, sum( case when f1 = 'D' then cnt else 0 end) as D_COUNT, sum( case when f1 = 'R' then cnt else 0 end) as R_COUNT, sum( case when f1 = 'X' then cnt else 0 end) as X_COUNT from (select field_group, f1, count (*) as cnt from tab group by field_group, f1) a

Re: [SQL] how to inherits the references...

2002-07-12 Thread Stephan Szabo
On Fri, 12 Jul 2002, [iso-8859-1] frederik nietzsche wrote: > ok, thanks for the (double: two mails ;) ) help, but > in this way when I insert a record in a child table, > the key must be already present in the "sigles" table, > otherwise it breaks the reference and doesn't insert > anything. >

Re: [SQL] rules / triggers on insert. why after?

2002-07-12 Thread Jan Wieck
Ahti Legonkov wrote: > Does anyone know why since postgres 7.2 the rules are executed *after* > the insert? Because people where still complaining that they changed to execute *before* in v6.4. Jan -- #==# # It's easier to

Re: [SQL] list of tables ?

2002-07-12 Thread Christoph Haller
> > can anyone point me in the right direction ? > > i need to list all the tables in a database. > Steve, Your request reminds me of a similar problem I had. Try the following: CREATE VIEW sesql_usertables AS SELECT UPPER(u.usename) AS tbl_owner, UPPER(c.relname) AS tbl_name, UPPER(a.att

Re: [SQL] [HACKERS] please help on query

2002-07-12 Thread Luis Alberto Amigo Navarro
I've tried SELECT supplier.name, supplier.address FROM supplier, nation, lineitem WHERE EXISTS( SELECT partsupp.suppkey FROM partsupp,lineitem WHERE lineitem.partkey=partsupp.partkey AND lineitem.suppkey=partsupp.partkey AND lineitem.shipdate>=('1994-01-01')::DATE AND

Re: [SQL] [HACKERS] please help on query

2002-07-12 Thread Jakub Ouhrabka
hi, avoid subselect: create a temp table and use join... CREATE TEMP TABLE tmp AS SELECT lineitem.orderkey FROM lineitem WHERE lineitem.orderkey=orders.orderkey GROUP BY lineitem.orderkey HAVING sum(lineitem.quantity)>300; CREATE INDEX tmp_idx ON tmp (orderkey);

[SQL] rules / triggers on insert. why after?

2002-07-12 Thread Ahti Legonkov
Hi, I have the following things in my database: CREATE SEQUENCE "REO_ID_seq" INCREMENT 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1; CREATE TABLE reo ( "REO_ID" int4 DEFAULT nextval('"REO_ID_seq"'::text) NOT NULL, "TYPE" varchar(64) NOT NULL, CONSTRAINT "REO_ID_reo_ukey" UNIQUE ("REO_ID")

Re: [SQL] [HACKERS] please help on query

2002-07-12 Thread Jakub Ouhrabka
hi, avoid subselect: create a temp table and use join... CREATE TEMP TABLE tmp AS SELECT lineitem.orderkey FROM lineitem WHERE lineitem.orderkey=orders.orderkey GROUP BY lineitem.orderkey HAVING sum(lineitem.quantity)>300; CREATE INDEX tmp_idx ON tmp (orderkey);

Re: [SQL] [HACKERS] please help on query

2002-07-12 Thread Luis Alberto Amigo Navarro
> The cost is now only 1141741215.35 compared to 2777810917708.17 > before; this is an improvement factor of more than 2000. So what's > your problem? ;-) > > Servus > Manfred > In fact planner is estimating incredibly badly, it took only 833msecs now runs perfectly I'm going to keep on ask

Re: [SQL] how to inherits the references...

2002-07-12 Thread frederik nietzsche
ok, thanks for the (double: two mails ;) ) help, but in this way when I insert a record in a child table, the key must be already present in the "sigles" table, otherwise it breaks the reference and doesn't insert anything. In order to use this solution I must create a set of function that when I