- Notifications
You must be signed in to change notification settings - Fork28
Commit6ef7714
committed
> >> My question is whether postgres can index null values, and if not, do I
> >> have to accept a full table scan when locating records.> >> > It indexes them, but "is null" is not an indexable operator, so you> > can't directly solve the above with a 3-column index. What you can do> > instead is use a partial index, for instance> >> > create index i on CUSTOMER.WCCustOrderStatusLog (WCOrderStatusID)> > where Acknowledged is null and Processing is null;>> That's a very nifty trick and exactly the sort of answer I was after!Add CREATE INDEX doc mention of using partial indexes for IS NULLindexing; idea from Tom.1 parent6949fc0 commit6ef7714
1 file changed
+12
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
79 | 87 | | |
80 | 88 | | |
81 | | - | |
82 | | - | |
| 89 | + | |
| 90 | + | |
83 | 91 | | |
84 | 92 | | |
85 | 93 | | |
| |||
0 commit comments
Comments
(0)