[HACKERS] Indexes with duplicate columns

2011-12-22 Thread Tom Lane
In bug #6351 it's pointed out that this fails unexpectedly: CREATE TABLE tab (id SERIAL, a INTEGER, b INTEGER); CREATE INDEX tab123 ON tab (a, b, a); SELECT a, b FROM tab WHERE a = 0 AND b = 1; ERROR: btree index keys must be ordered by attribute I looked into this a bit and find that indxpath.c

Re: [HACKERS] Indexes vs. cache flushes

2006-01-19 Thread Tom Lane
"Jim C. Nasby" <[EMAIL PROTECTED]> writes: > How would this affect changing the type of a column? It doesn't, because we drop and rebuild indexes completely during ALTER COLUMN TYPE. regards, tom lane ---(end of broadcast)--

Re: [HACKERS] Indexes vs. cache flushes

2006-01-19 Thread Jim C. Nasby
On Thu, Jan 19, 2006 at 02:46:11AM -0500, Tom Lane wrote: > Greg Stark <[EMAIL PROTECTED]> writes: > > Tom Lane <[EMAIL PROTECTED]> writes: > >> But you couldn't make any meaningful changes in the definition of an > >> index, such as changing its column set, operator classes, partial-index > >> pre

Re: [HACKERS] Indexes vs. cache flushes

2006-01-19 Thread Martijn van Oosterhout
On Thu, Jan 19, 2006 at 02:46:11AM -0500, Tom Lane wrote: > The concerns that I find more interesting are changes in the underlying > objects. We don't have an ALTER OPERATOR CLASS, much less an ALTER > ACCESS METHOD, but it's certainly theoretically possible to change the > definition of a suppor

Re: [HACKERS] Indexes vs. cache flushes

2006-01-18 Thread Tom Lane
Greg Stark <[EMAIL PROTECTED]> writes: > Tom Lane <[EMAIL PROTECTED]> writes: >> But you couldn't make any meaningful changes in the definition of an >> index, such as changing its column set, operator classes, partial-index >> predicate, etc, except by dropping and recreating it. > The only examp

Re: [HACKERS] Indexes vs. cache flushes

2006-01-18 Thread Greg Stark
Tom Lane <[EMAIL PROTECTED]> writes: > This would still support REINDEX (which changes pg_class.relfilenode in > order to replace the physical file) and ALTER INDEX SET TABLESPACE. > But you couldn't make any meaningful changes in the definition of an > index, such as changing its column set, ope

[HACKERS] Indexes vs. cache flushes

2006-01-18 Thread Tom Lane
I've been working on getting the system to pass regression tests cleanly when forcing a cache flush at every possible instant. The main tests pass now (in 8.1 --- HEAD remains broken pending lookup_rowtype_tupdesc fix), but contrib is still crashing. On investigation the problem turns out to be i

Re: [HACKERS] indexes spanning multiple tables

2005-08-22 Thread Joshua N Pritikin
On Mon, Aug 22, 2005 at 04:01:04PM -0400, Tom Lane wrote: > Joshua N Pritikin <[EMAIL PROTECTED]> writes: > > Is anybody working on allowing indexes to span multiple tables? > > IF not, I'll give it a try. > > Wouldn't recommend it as a project for a beginning backend hacker; > the locking conside

Re: [HACKERS] indexes spanning multiple tables

2005-08-22 Thread Hannu Krosing
On E, 2005-08-22 at 16:01 -0400, Tom Lane wrote: > Joshua N Pritikin <[EMAIL PROTECTED]> writes: > > Is anybody working on allowing indexes to span multiple tables? > > IF not, I'll give it a try. > > Wouldn't recommend it as a project for a beginning backend hacker; > the locking considerations a

Re: [HACKERS] indexes spanning multiple tables

2005-08-22 Thread Tom Lane
Joshua N Pritikin <[EMAIL PROTECTED]> writes: > Is anybody working on allowing indexes to span multiple tables? > IF not, I'll give it a try. Wouldn't recommend it as a project for a beginning backend hacker; the locking considerations alone are a bit daunting. See the archives for prior discussi

[HACKERS] indexes spanning multiple tables

2005-08-22 Thread Joshua N Pritikin
Is anybody working on allowing indexes to span multiple tables? IF not, I'll give it a try. -- Make April 15 just another day, visit http://fairtax.org signature.asc Description: Digital signature

Re: [HACKERS] Indexes

2003-01-16 Thread Nigel J. Andrews
On Thu, 16 Jan 2003, Tom Lane wrote: > > mlw said: > >>> Does anyone think it would be a good idea, or is it even practical, to > >>> have a 'indx' subdirectory along side of the 'base' directory? > >>> > >>> I was thinking that, if it were an easy modification, that it could be > >>> an easy w

Re: [HACKERS] Indexes

2003-01-16 Thread Tom Lane
> mlw said: >>> Does anyone think it would be a good idea, or is it even practical, to >>> have a 'indx' subdirectory along side of the 'base' directory? >>> >>> I was thinking that, if it were an easy modification, that it could be >>> an easy way to separate data and indexes to different hard

[HACKERS] Indexes

2003-01-16 Thread mlw
Does anyone think it would be a good idea, or is it even practical, to have a 'indx' subdirectory along side of the 'base' directory? I was thinking that, if it were an easy modification, that it could be an easy way to separate data and indexes to different hard disks. ---

[HACKERS] Indexes, TOAST tables, and namespaces

2002-03-26 Thread Tom Lane
I'm trying to work out what to do with indexes in the context of schemas. As of today's CVS tip, what the code does is that CREATE INDEX can only specify an unqualified index name, and the index is automatically created in the same namespace as its parent table. Thus, index names still have to b

Re: [HACKERS] indexes and big tables

2001-07-28 Thread Robert Vojta
> Is there any possibility of overlapping rows between the parts of the > union? If not, I'd suggest union all, since that might get rid of the top > level unique and sort steps (probably not a huge gain, but might help). Hi, thanx for the response, there is a little possibility of overlapping

Re: [HACKERS] indexes and big tables

2001-07-27 Thread Stephan Szabo
On Fri, 27 Jul 2001, Robert Vojta wrote: > netacc=> EXPLAIN (SELECT SUM(counterfrom) AS from, SUM(counterto) AS to, > floor((985098900 - date_part('epoch', counterstamp)) / 300) AS sequence > FROM counters WHERE line='absolonll' AND date_part('epoch', counterstamp) > > 984978900 GROUP BY sequence

Re: [HACKERS] indexes and big tables

2001-07-27 Thread Robert Vojta
> The index is only used for the line= part of the where clause > with your query. With many rows the "line=" is not selective enough > to justify the index. I tried move only needed data into new table and change query into ... netacc=> EXPLAIN SELECT counterfrom AS from, counterto AS to, fl

Re: [HACKERS] indexes and big tables

2001-07-27 Thread Robert Vojta
> The index is only used for the line= part of the where clause > with your query. With many rows the "line=" is not selective enough > to justify the index. Hi, I tried you suggestion about 'AND counterstamp > '2001-07-26 00:00:00.0' and it works and index is used :) But, whole query run for

Re: [HACKERS] indexes and big tables

2001-07-27 Thread Robert Vojta
> I would guess the problem is the restriction on counterstamp, because > written like that, it probably can't use the index. > > try something where you avoid the use of the date_part function e.g.: > AND counterstamp > '2001-07-26 00:00:00.0' I will try it, but it use the index when t

AW: [HACKERS] indexes and big tables

2001-07-27 Thread Zeugswetter Andreas SB
> netacc=> EXPLAIN (SELECT SUM(counterfrom) AS from, > SUM(counterto) AS to, > floor((985098900 - date_part('epoch', counterstamp)) / 300) > AS sequence > FROM counters WHERE line='absolonll' AND date_part('epoch', > ) counterstamp > 984978900 GROUP BY sequence, line) ... I would guess the pr

[HACKERS] indexes and big tables

2001-07-27 Thread Robert Vojta
Hi, I'm fighting with problem with indexes. I read documentation about performance tips, about internal logic functions which are making decision if to use or not use indexes, etc. and I'm still failed. I'm not SQL guru and I don't know what to do now. My tables and indexes looks like ... CREAT

Re: [HACKERS] Indexes not used in 7.1RC4: Bug?

2001-04-10 Thread Stephan Szabo
> url_idx seems OK: > > logger=# EXPLAIN SELECT * FROM access_log WHERE url_id = 1000; > Index Scan using url_idx on access_log > (cost=0.00..3618.92 rows=1002 width=89) > > > > But the others not: > > logger=# EXPLAIN SELECT * FROM access_log WHERE method_num = 0; > Seq Scan

[HACKERS] Indexes not used in 7.1RC4: Bug?

2001-04-10 Thread Alvar Freude
Hi, I have the following table, containing about 57 Rows, but some indexes are not used, on 7.1RC4, freshly vacuumed (analyse). It was the same at least in 7.1RC1 --- SNIP --- CREATE TABLE access_log( site_id int2NOT NULL DEFAULT 0, access_time timestam