Skip site navigation (1) Skip section navigation (2)

Fw: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards

From: "Joe Conway" <joseph(dot)conway(at)home(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Fw: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards
Date: 2001-06-25 15:17:24
Message-ID: 008601c0fd89$f047fb50$48d210ac@jecw2k1 (view raw or flat)
Thread:
Lists: pgsql-hackers
(Sorry if you receive this twice, but I sent it Saturday evening and it
never made it to the list)

Thanks for your thorough review and comments, Tom.

Here's a new patch for review. Summary of changes/response to earlier
comments:
- add a routine for NullTest nodes -- done.
- declare selectivity functions without fmgr notation -- done.
- create selfuncs.h for declarations -- done, but I didn't move anything
else out of builtins.h
- use DatumGetBool() and adjust style -- done
- create better default selectivities -- done:
     - DEFAULT_UNK_SEL = 0.005
     - DEFAULT_NOT_UNK_SEL = 1 - DEFAULT_UNK_SEL
     - DEFAULT_BOOL_SEL = 0.5
- recurse clause_selectivity() for non-Var input -- done
- simplify MCV logic -- done, used 2nd approach (always use the first most
common val's frequency)

Questions:
- I added a debug define (BOOLTESTDEBUG) to selfuncs.h, and a corresponding
ifdef/elog NOTICE to clause_selectivity(). This was to help me debug/verify
the calculations. Should this be left in the code when I create a patch (it
is in this one), and if so, is there a preferred "standard" approach to this
type of debug code?
- Using the debug code mentioned above, I noted that clause_selectivity()
did not seem to get called at all for clauses like "where myfield = 0" or
"where myfield > 0". I haven't looked too closely at it yet, but I was
wondering if this is expected behavior?

Thanks,

-- Joe


Attachment: newnodesel_01.diff
Description: application/octet-stream (11.2 KB)

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2001-06-25 15:25:11
Subject: Re: AW: AW: AW: [PATCH] Re: Setuid functions
Previous:From: Zeugswetter Andreas SBDate: 2001-06-25 15:00:37
Subject: AW: AW: AW: [PATCH] Re: Setuid functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group