Re: [SQL] [PERFORM] SQL Query Performance - what gives?

2009-08-18 Thread Karl Denninger
Tom Lane wrote: > Karl Denninger writes: > >> The problem appearsa to lie in the "nested loop", and I don't understand >> why that's happening. >> > It looks to me like there are several issues here. > > One is the drastic underestim

Re: [SQL] [PERFORM] SQL Query Performance - what gives?

2009-08-18 Thread Karl Denninger
Kevin Grittner wrote: > Karl Denninger wrote: > >>-> Index Scan using forum_name on forum >> (cost=0.00..250.63 rows=1 width=271) (actual time=0.013..0.408 >> rows=63 loops=1) >> Filter: (((contrib IS NULL) OR (contrib =

Re: [SQL] [PERFORM] SQL Query Performance - what gives?

2009-08-18 Thread Karl Denninger
| open| text | Indexes: "forum_pkey" PRIMARY KEY, btree (name) "forum_name" UNIQUE, btree (name) "forum_order" UNIQUE, btree (forum_order) Triggers: _tickerforum_logtrigger AFTER INSERT OR DELETE OR UPDATE ON

[SQL] SQL Query Performance - what gives?

2009-08-18 Thread Karl Denninger
Let's take the following EXPLAIN results: ticker=# explain select * from post, forum where forum.name = post.forum and invisible <> 1 and to_tsvector('english', message) @@ to_tsquery('violence') order by modified desc limit 100;

[SQL] SQL syntax I've been unable to figure out....

2008-12-25 Thread Karl Denninger
the table. I can do it programmatically (e.g. from "C" selecting the table ordered by URIs, distinct by name) and then stepping through by hand, but can't figure out a single SQL statement that will accomplish this. Thanks in advance -- -- Karl Denninger k...@denninger.net begin:

[SQL] Whassup with this? (create table .... like ... fails)

2008-07-19 Thread Karl Denninger
childrensjustice=# create table petition_new like petition_bail; ERROR: syntax error at or near "like" LINE 1: create table petition_new like petition_bail; -- Karl Denninger ([EMAIL PROTECTED]) http://www.denninger.net -- Sent via pgsql-sql mailing l

Re: [SQL] SQL question....

2008-05-21 Thread Karl Denninger
Steve Midgley wrote: At 12:20 PM 5/21/2008, [EMAIL PROTECTED] wrote: Date: Wed, 21 May 2008 06:39:11 -0500 From: Karl Denninger <[EMAIL PROTECTED]> To: Gurjeet Singh <[EMAIL PROTECTED]> Cc: pgsql-sql@postgresql.org Subject: Re: SQL question Message-ID: <[EMAIL PROTECTED]&g

Re: [SQL] SQL question....

2008-05-21 Thread Karl Denninger
Gurjeet Singh wrote: On Wed, May 21, 2008 at 8:33 AM, Karl Denninger <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: Gurjeet Singh wrote: On Wed, May 21, 2008 at 4:47 AM, Karl Denninger <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

Re: [SQL] SQL question....

2008-05-20 Thread Karl Denninger
Gurjeet Singh wrote: On Wed, May 21, 2008 at 4:47 AM, Karl Denninger <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: Gurjeet Singh wrote: On Tue, May 20, 2008 at 11:44 PM, Karl Denninger <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> <

Re: [SQL] SQL question....

2008-05-20 Thread Karl Denninger
Gurjeet Singh wrote: On Tue, May 20, 2008 at 11:44 PM, Karl Denninger <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: assuming the following schema: create table access (name text, address ip) I want to construct a SELECT statement which will return ONL

Re: [SQL] SQL question....

2008-05-20 Thread Karl Denninger
chester c young wrote: create table access (name text, address ip) I want to construct a SELECT statement which will return ONLY tuples containing IP and name pairs IF there is an IP that has two or more NAMEs associated with it. many ways: select a1.* from access a1 where exists(

[SQL] SQL question....

2008-05-20 Thread Karl Denninger
get a list of all IPs and names ordered by IP, which I could then parse with a different program (e.g. "Select name, address from access order by address"), but the idea of course is to do it with one SELECT statement and return only rows that have multiple names listed for a give

Re: [SQL] BLOBs vs BYTEA

2005-02-01 Thread Karl Denninger
the database in the database. This requires some more work for binary objects in the application code, but not much. And, it insures that integrity is maintained. Otherwise you need a "cleanup" routine to cover the possibility of a file missing metadata, or metadata missing a file,

Re: [SQL] Ok, what am I doing wrong here?

2004-02-17 Thread Karl Denninger
Thanks... -- -- Karl Denninger ([EMAIL PROTECTED]) Internet Consultant & Kids Rights Activist http://www.denninger.netTired of spam at your company? LOOK HERE! http://childrens-justice.orgWorking for family and children's rights http://diversunion.org LOG IN AND

[SQL] Ok, what am I doing wrong here?

2004-02-17 Thread Karl Denninger
herwise, as does "\h insert" from the command line. The query stand-alone returns a table with values that are valid for the table I wish to insert into. Where's my brain-fade on this? -- -- Karl Denninger ([EMAIL PROTECTED]) Internet Consultant & Kids Rights Activist http