[PERFORM] Feature request: smarter use of conditional indexes

2004-06-10 Thread John Siracusa
Given an index like this: CREATE UNIQUE INDEX i1 ON t1 (c1) WHERE c1 IS NOT NULL; and a query like this: SELECT * FROM t1 WHERE c1 = 123; I'd like the planner to be smart enough to use an index scan using i1. Yes, I can change the query to this: SELECT * FROM t1 WHERE c1 = 123 AND

Re: [PERFORM] Feature request: smarter use of conditional indexes

2004-03-09 Thread CoL
hi, John Siracusa wrote, On 3/3/2004 20:56: Given an index like this: CREATE UNIQUE INDEX i1 ON t1 (c1) WHERE c1 IS NOT NULL; and a query like this: SELECT * FROM t1 WHERE c1 = 123; I'd like the planner to be smart enough to use an index scan using i1. Yes, I can change the query to

Re: [PERFORM] Feature request: smarter use of conditional indexes

2004-03-08 Thread Bruce Momjian
Tom Lane wrote: > Larry Rosenman <[EMAIL PROTECTED]> writes: > > Just a suggestion, please use diff -c format, as it makes it easier for > > the folks who apply the patches to do so. > > That's not just a suggestion ... patches that aren't in diff -c (or at > least diff -u) format will be rejected

Re: [PERFORM] Feature request: smarter use of conditional indexes

2004-03-06 Thread Tom Lane
Larry Rosenman <[EMAIL PROTECTED]> writes: > Just a suggestion, please use diff -c format, as it makes it easier for > the folks who apply the patches to do so. That's not just a suggestion ... patches that aren't in diff -c (or at least diff -u) format will be rejected out of hand. Without the c

Re: [PERFORM] Feature request: smarter use of conditional indexes

2004-03-06 Thread Larry Rosenman
--On Saturday, March 06, 2004 21:29:27 -0500 John Siracusa <[EMAIL PROTECTED]> wrote: On 3/3/04 6:53 PM, Tom Lane wrote: John Siracusa <[EMAIL PROTECTED]> writes: Given an index like this: CREATE UNIQUE INDEX i1 ON t1 (c1) WHERE c1 IS NOT NULL; and a query like this: SELECT * FROM

Re: [PERFORM] Feature request: smarter use of conditional indexes

2004-03-06 Thread John Siracusa
On 3/3/04 6:53 PM, Tom Lane wrote: John Siracusa <[EMAIL PROTECTED]> writes: Given an index like this: CREATE UNIQUE INDEX i1 ON t1 (c1) WHERE c1 IS NOT NULL; and a query like this: SELECT * FROM t1 WHERE c1 = 123; I'd like the planner to be smart enough to use an index scan using i1

Re: [PERFORM] Feature request: smarter use of conditional indexes

2004-03-06 Thread Tom Lane
John Siracusa <[EMAIL PROTECTED]> writes: > So apparently all I can do is find out if it's a null test, but not if it is > specifically "IS NOT NULL" No, because once you have determined that the node really IsA NullTest, you can cast the pointer to (NullTest *) and look at the NullTest-specific f

Re: [PERFORM] Feature request: smarter use of conditional indexes

2004-03-06 Thread John Siracusa
On 3/3/04 6:53 PM, Tom Lane wrote: > John Siracusa <[EMAIL PROTECTED]> writes: >> Given an index like this: >> CREATE UNIQUE INDEX i1 ON t1 (c1) WHERE c1 IS NOT NULL; >> and a query like this: >> SELECT * FROM t1 WHERE c1 = 123; >> I'd like the planner to be smart enough to use an index sca

Re: [PERFORM] Feature request: smarter use of conditional indexes

2004-03-03 Thread Christopher Kings-Lynne
Given an index like this: CREATE UNIQUE INDEX i1 ON t1 (c1) WHERE c1 IS NOT NULL; and a query like this: SELECT * FROM t1 WHERE c1 = 123; I'd like the planner to be smart enough to use an index scan using i1. Send a patch ;-) The routine you want to teach about this is pred_test_simple_cl

Re: [PERFORM] Feature request: smarter use of conditional indexes

2004-03-03 Thread Tom Lane
John Siracusa <[EMAIL PROTECTED]> writes: > Given an index like this: > CREATE UNIQUE INDEX i1 ON t1 (c1) WHERE c1 IS NOT NULL; > and a query like this: > SELECT * FROM t1 WHERE c1 = 123; > I'd like the planner to be smart enough to use an index scan using i1. Send a patch ;-) The routine