Re: [SQL] Am I wasting my time with partitions?

2008-02-19 Thread Stuart Brooks
It seems to me that postgresql doesn't use indexes when being asked for an ordered result sets from a partitioned table. I have an application where this is critical, but I was hoping to use partitions because of the ease of rotating out old rows. metadb=> explain select * from l order by a

Re: [SQL] SELECT DISTINCT

2008-02-19 Thread Richard Huxton
Shavonne Marietta Wijesinghe wrote: Hello I have 2 records with the same value. Even when i do a select with DISTINCT, it returns me both the records instead of one. SELECT DISTINCT ON (TE_COGNOME) TE_COGNOME, TE_NOME, N_GEN_TEST, TE_SESSO, TE_ATTNASC, TE_LUONASC, TE_INDI, TE_DTNASC, TE_PROVSTA

Re: [SQL] Am I wasting my time with partitions?

2008-02-19 Thread Richard Huxton
Stuart Brooks wrote: It seems to me that postgresql doesn't use indexes when being asked for an ordered result sets from a partitioned table. I have an application where this is critical, but I was hoping to use partitions because of the ease of rotating out old rows. metadb=> explain select

[SQL] UPDATE with ORDER BY

2008-02-19 Thread Robins Tharakan
Hi, I know this kind of a question is asked earlier, but I couldn't find an answer there (in the previous round of posting). Instead of wanting to update the first record in an UPDATE .. ORDER BY condition, (because of triggers that act downward) what I want is that all records be updated, but in

[SQL] Am I wasting my time with partitions?

2008-02-19 Thread Stuart Brooks
It seems to me that postgresql doesn't use indexes when being asked for an ordered result sets from a partitioned table. I have an application where this is critical, but I was hoping to use partitions because of the ease of rotating out old rows. Simply put, I have a table called LineItems wh

[SQL] SELECT DISTINCT

2008-02-19 Thread Shavonne Marietta Wijesinghe
Hello I have 2 records with the same value. Even when i do a select with DISTINCT, it returns me both the records instead of one. SELECT DISTINCT ON (TE_COGNOME) TE_COGNOME, TE_NOME, N_GEN_TEST, TE_SESSO, TE_ATTNASC, TE_LUONASC, TE_INDI, TE_DTNASC, TE_PROVSTATO, TE_PROV, TE_PATERNITA, TE_RICH