Re: [HACKERS] SELECT * FROM table LIMIT 1; is really slow

2004-05-27 Thread Dennis Bjorklund
On Wed, 26 May 2004, Tom Lane wrote: if you have to do an UPDATE that affects every row of a large table UPDATE tab SET col = col + 1 which leaves you with N live rows, N dead rows, and lots of pain to get back down to a less-than-twice-normal-size table. (Traditional way is

Re: [HACKERS] Nested xacts: looking for testers and review

2004-05-27 Thread Stephan Szabo
On Thu, 27 May 2004, Alvaro Herrera wrote: On Wed, May 26, 2004 at 04:35:52PM -0700, Stephan Szabo wrote: On Wed, 26 May 2004, Alvaro Herrera wrote: I'm missing one item: deferred triggers. The problem with this is that the deftrig queue is not implemented using normal Lists, so

Re: [HACKERS] How can I have 2 completely seperated databases in

2004-05-27 Thread Rod Taylor
On Wed, 2004-02-11 at 16:36, [EMAIL PROTECTED] wrote: Hi, all What should I do if I want to have 2 completely seperated databases in PostgreSQL? I want each database to have its own data, log and everything needed to access that database. I don't want them to share anything. Has anyone done

Re: [HACKERS] SELECT * FROM table LIMIT 1; is really slow

2004-05-27 Thread Zeugswetter Andreas SB SD
What would be useful for that (as of 7.5) is a dummy ALTER TABLE TYPE, viz ALTER TABLE tab ALTER COLUMN col TYPE same-type-it-already-has I think we should add special syntax for this purpose, since I would like to (or someone else later on) see all possible cases of alter column

Re: [HACKERS] tablespaces and DB administration

2004-05-27 Thread Andreas Pflug
James Robinson wrote: Users are primarily, if not stupid, ignorant. They will read the absolute minimum needed to achieve a goal and little else. I say this with the utmost respect, because I and probably everyone else on this group is guilty of the same thing. So, the preferred installation

Re: [HACKERS] tablespaces and DB administration

2004-05-27 Thread pgsql
Yes, that is generally the case (prefer pg_xlog on separate spindle), but no need to *forcibly* overcomplicate things if the box has only one spindle, or if they have only one single RAID'd partition configured. We should continue to err on the side of keeping the path to a functional system

Re: [HACKERS] tablespaces and DB administration

2004-05-27 Thread pgsql
James Robinson wrote: Users are primarily, if not stupid, ignorant. They will read the absolute minimum needed to achieve a goal and little else. I say this with the utmost respect, because I and probably everyone else on this group is guilty of the same thing. So, the preferred

Re: [HACKERS] SELECT * FROM table LIMIT 1; is really slow

2004-05-27 Thread Tom Lane
Dennis Bjorklund [EMAIL PROTECTED] writes: On Wed, 26 May 2004, Tom Lane wrote: I'm not real sure where to document this trick but it seems like we ought to mention it someplace. Isn't it better to detect a UPDATE without a where and do that update in the same way as the alter table above?

Re: [HACKERS] SELECT * FROM table LIMIT 1; is really slow

2004-05-27 Thread David Blasby
I did a CLUSTER - it took just under 12 hours. The original load of the table (including parsing all the geometries) took about 4 hours (+4 to build the indexes and vacuum analyse). I dont know why the cluster is so much slower... My SELECT * FROM table LIMIT 1; is now fast. Thanks for the

Re: [HACKERS] tablespaces and DB administration

2004-05-27 Thread Josh Berkus
Mohawksoft: I forgot to specify that tablepaces should be on separate volumes. (sorry) If all they have is one volume, no worries, but instructing the use of alternate volumes for system and data will improve performance by separating WAL and data operations. ... and the place for this is

Re: [HACKERS] tablespaces and DB administration

2004-05-27 Thread Andreas Pflug
[EMAIL PROTECTED] wrote: James Robinson wrote: Users are primarily, if not stupid, ignorant. They will read the absolute minimum needed to achieve a goal and little else. I say this with the utmost respect, because I and probably everyone else on this group is guilty of the same thing. So,

Re: [HACKERS] tablespaces and DB administration

2004-05-27 Thread pgsql
In the age of inexpensive RAID, tablespaces have more or less lost their relevance regarding performance. pgsql's philosophy respects this by leaving the storage work up to the OS and disk subsystem. Even having the xlog on a different spindle won't help too much; you'll probably be better

Re: [HACKERS] tablespaces and DB administration

2004-05-27 Thread pgsql
[EMAIL PROTECTED] wrote: James Robinson wrote: Users are primarily, if not stupid, ignorant. They will read the absolute minimum needed to achieve a goal and little else. I say this with the utmost respect, because I and probably everyone else on this group is guilty of the same thing. So,

Re: [HACKERS] tablespaces and DB administration

2004-05-27 Thread pgsql
Mohawksoft: I forgot to specify that tablepaces should be on separate volumes. (sorry) If all they have is one volume, no worries, but instructing the use of alternate volumes for system and data will improve performance by separating WAL and data operations. ... and the place for this is

Re: [HACKERS] tablespaces and DB administration

2004-05-27 Thread Andreas Pflug
[EMAIL PROTECTED] wrote: As you can see, it takes a LOT longer. That's because the disk has to do a lot more work, the hardware data path has to carry twice as much data, and you have to manage multiple accesses to a single object, the disk. It doesn't take much imagination to see what this would

Re: [HACKERS] SELECT * FROM table LIMIT 1; is really slow

2004-05-27 Thread Manfred Koizar
On Wed, 26 May 2004 18:17:55 -0400, Tom Lane [EMAIL PROTECTED] wrote: (Some days I think we should dump VACUUM FULL, because it's optimized for a case that's no longer very interesting...) So we still have to stick with VACUUM FULL for some time, right? The next set of compatibility breakers I'm

Re: [HACKERS] SELECT * FROM table LIMIT 1; is really slow

2004-05-27 Thread Tom Lane
Manfred Koizar [EMAIL PROTECTED] writes: XX.. ..y. and when y is updated the new version will be stored in a lower block Oh? What makes you think that? I see no guarantee of it. AFAICS this would make vacuum.c much simpler (no more chain moves). How will

Re: [HACKERS] list rewrite committed

2004-05-27 Thread Neil Conway
Jeff wrote: Do we have any numbers as to how much this will help things? No, I haven't done any benchmarking yet (I might do some before I leave for the summer, but it's not a priority...) FWIW, the performance improvement from this patch won't be as large as it might be, since Tom already

Re: [HACKERS] SELECT * FROM table LIMIT 1; is really slow

2004-05-27 Thread Manfred Koizar
On Thu, 27 May 2004 14:23:07 -0400, Tom Lane [EMAIL PROTECTED] wrote: and when y is updated the new version will be stored in a lower block Oh? What makes you think that? I see no guarantee of it. You're right, I see only a tendency, because the majority of free space is before the last block

[HACKERS] How to get the Oid of the Primary key relation ??

2004-05-27 Thread Ramanujam H S Iyengar
Can some one help me in the question !!! Given the Oid of a relation .. how to get the Oid of the Primary key index on that relation ? Thanks in adv, -Ramu _ Post Classifieds on MSN classifieds. http://go.msnserver.com/IN/44045.asp

Re: [HACKERS] tablespaces and DB administration

2004-05-27 Thread pgsql
[EMAIL PROTECTED] wrote: As you can see, it takes a LOT longer. That's because the disk has to do a lot more work, the hardware data path has to carry twice as much data, and you have to manage multiple accesses to a single object, the disk. It doesn't take much imagination to see what this

[HACKERS] Win32, PITR, nested transactions, tablespaces

2004-05-27 Thread Bruce Momjian
Nearing our June 1 feature freeze, we now have patches for all our major outstanding features. Their status is: Win32 - almost done, fsync needed, bug fixes, etc PITR - Simon is away until Sunday and we are working on it Nested transactions - patch needs review, trigger

Re: [HACKERS] SELECT * FROM table LIMIT 1; is really slow

2004-05-27 Thread Alvaro Herrera
On Thu, May 27, 2004 at 09:52:30PM +0200, Manfred Koizar wrote: I have no clear explanation at the moment, just some fuzzy ideas that are beginning to crystallise. I'm messing around with heap tuple headers again, and the Xvac field seems to get in the way, unless I can cut down the number

Re: [HACKERS] tablespaces and DB administration

2004-05-27 Thread pgsql
[EMAIL PROTECTED] wrote: You are absolutely wrong on all accounts here. A RAID5 system is slower than a single spindle as it is only as fast as the slowest disk in the stripe and the overhead of the RAID. Huh, what kind of controller do you use... Sounds like some value IDE one. I'd never

Re: [HACKERS] tablespaces and DB administration

2004-05-27 Thread Darcy Buskermolen
On May 27, 2004 01:38 pm, [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: As you can see, it takes a LOT longer. That's because the disk has to do a lot more work, the hardware data path has to carry twice as much data, and you have to manage multiple accesses to a single object, the

Re: [HACKERS] How to get the Oid of the Primary key relation ??

2004-05-27 Thread John Hansen
On Fri, 2004-05-28 at 06:07, Ramanujam H S Iyengar wrote: Can some one help me in the question !!! Given the Oid of a relation .. how to get the Oid of the Primary key index on that relation ? Attached, a couple of function I wrote that might do what you're after. Thanks in adv,

[HACKERS] On query rewrite

2004-05-27 Thread Sailesh Krishnamurthy
Hackers Are there any default query rewrite rules that kick in, in the absence of any user-defined RULE or VIEW ? Also, is there any place that lists any interesting query rewrite that PG does on queries for perf. improvement ? For instance, in the presence of a view or a subquery, does PG do

Re: [HACKERS] On query rewrite

2004-05-27 Thread Alvaro Herrera
On Thu, May 27, 2004 at 05:14:48PM -0700, Sailesh Krishnamurthy wrote: Are there any default query rewrite rules that kick in, in the absence of any user-defined RULE or VIEW ? Also, is there any place that lists any interesting query rewrite that PG does on queries for perf. improvement ?

Re: [HACKERS] tablespaces and DB administration

2004-05-27 Thread pgsql
One other huge advantage that tablespaces will bring, it the ability to place data based on cost ie, you can put your 10 most used tables on fast disk (or perhaps solid state devices), and move the seldom used data off onto the slower (lower cost) disks/storage array. Great idea.

Re: [HACKERS] Win32, PITR, nested transactions, tablespaces

2004-05-27 Thread Tatsuo Ishii
Hi Bruce, Is that core's decision that: o below all four major features will be incorporated into 7.5 o beta freeze will be June 1 In the upcoming big event Linux World (in Tokyo, from June 2 to 4) I need to present about current status of PostgreSQL development. Even if cores have not decided

Re: [HACKERS] On query rewrite

2004-05-27 Thread Sailesh Krishnamurthy
Alvaro == Alvaro Herrera [EMAIL PROTECTED] writes: For instance, in the presence of a view or a subquery, does PG do a subquery to join transformation ? Alvaro Yes, there are transformations of this sort, but they are Alvaro not called query rewrite in the code's terminology,

Re: [HACKERS] Win32, PITR, nested transactions, tablespaces

2004-05-27 Thread Christopher Kings-Lynne
Nearing our June 1 feature freeze, we now have patches for all our major outstanding features. Their status is: Win32 - almost done, fsync needed, bug fixes, etc PITR - Simon is away until Sunday and we are working on it Nested transactions - patch needs review, trigger

[HACKERS] pg_dump --comment?

2004-05-27 Thread Chris Campbell
I've encountered a situation where I'd like to store some information about the database when I do a pg_dump. For instance, the timestamp of the dump. And some other information that I pull from the database. If pg_dump had a --comment flag that allowed me to pass a string that would be stored

[HACKERS] Dynamic fieldname with NEW structure in trigger function?

2004-05-27 Thread Erwin Brandstetter
Hi List! I have discussed the following problem with pl/pgsql on irc://freenode/postgresql. irc://freenode/postgresql Christopher Kings-Lynne has asked me to post the problem here as a feature request, so here goes: I think it is best formulated in plpgsql code below. Kris Jurka has mentioned

Re: [HACKERS] On query rewrite

2004-05-27 Thread Alvaro Herrera
On Thu, May 27, 2004 at 06:27:47PM -0700, Sailesh Krishnamurthy wrote: Alvaro == Alvaro Herrera [EMAIL PROTECTED] writes: For instance, in the presence of a view or a subquery, does PG do a subquery to join transformation ? Alvaro Yes, there are transformations of this sort,

Re: [HACKERS] On query rewrite

2004-05-27 Thread Sailesh Krishnamurthy
Alvaro == Alvaro Herrera [EMAIL PROTECTED] writes: I understand that there is a cost-based optimizer anyway that does the planning and selects the right plan .. but does this come _after_ all these transformations ? Or does it happen along with the transformations ?

Re: [HACKERS] Win32, PITR, nested transactions, tablespaces

2004-05-27 Thread Bruce Momjian
Tatsuo Ishii wrote: Hi Bruce, Is that core's decision that: o below all four major features will be incorporated into 7.5 We don't know. If they can be added to CVS without major changes, they will be in 7.5. As far as I can tell: Win32 has 98% of its code in CVS, so it will

Re: [HACKERS] pg_dump --comment?

2004-05-27 Thread Christopher Kings-Lynne
I've encountered a situation where I'd like to store some information about the database when I do a pg_dump. For instance, the timestamp of the dump. And some other information that I pull from the database. I think every dump should dump the timestamp regardless... Chris

[HACKERS] hash, rtree and gist ScanLists

2004-05-27 Thread Alvaro Herrera
Hackers, I am updating the ScanLists so they can be dropped at subtransaction abort. Currently they are stored with custom next pointers; however it would be much cleaner to deal with deleting single items if they were Lists. Is it OK if I change them to be so? -- Alvaro Herrera

Re: [HACKERS] Win32, PITR, nested transactions, tablespaces

2004-05-27 Thread Bruce Momjian
Tatsuo Ishii wrote: Ok, BTW have we decided that next verison is marked as 7.5 or 8.0? No. Some argue that an 8.0 should only be done if we break backward compatibility, while others feel major features should cause an 8.0. -- Bruce Momjian| http://candle.pha.pa.us

Re: [HACKERS] hash, rtree and gist ScanLists

2004-05-27 Thread Christopher Kings-Lynne
I am updating the ScanLists so they can be dropped at subtransaction abort. Currently they are stored with custom next pointers; however it would be much cleaner to deal with deleting single items if they were Lists. Is it OK if I change them to be so? Alvaro, Have I mentioned that you're a

Re: [HACKERS] On query rewrite

2004-05-27 Thread Alvaro Herrera
On Thu, May 27, 2004 at 07:35:56PM -0700, Sailesh Krishnamurthy wrote: Anyway, thanks for the tips. I think I found what I'm looking for: the function is probably pull_up_subqueries .. and what it tries to do is check if a subquery is simple or not .. simple means not having Aggs or something

Re: [HACKERS] On query rewrite

2004-05-27 Thread Tom Lane
Sailesh Krishnamurthy [EMAIL PROTECTED] writes: Now my next question is more subtle .. Are these alternatives (pulling up vs not pulling up subqueries) considered in different plans ? That particular choice is not --- we do it if we can, else not. Comparisons between different alternatives

Re: [HACKERS] Win32, PITR, nested transactions, tablespaces

2004-05-27 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: Tatsuo Ishii wrote: Ok, BTW have we decided that next verison is marked as 7.5 or 8.0? No. Some argue that an 8.0 should only be done if we break backward compatibility, while others feel major features should cause an 8.0. In any case, it's premature