Re: [PERFORM] Million of rows

2005-03-29 Thread Michael Fuhr
ou VACUUM and ANALYZE the database regularly? Have you investigated whether you need to increase the statistics on any columns? Have you tuned postgresql.conf? What version of PostgreSQL are you using? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---

Re: [PERFORM] Reading recommendations

2005-03-30 Thread Michael Fuhr
documents: http://www.powerpostgresql.com/Docs/ > BTW. If you are a SQL/python programmer in (or near) Lanarkshire, > Scotland, we have a vacancy. ;-) Allow telecommute from across the pond and I might be interested :-) -- Michael Fuhr http://www.fuhr.org/~mfuhr/ --

Re: [PERFORM] date - range

2005-04-01 Thread Michael Fuhr
ueries, one with enable_seqscan set to "on" and one with it set to "off"? The planner might think that a sequential scan would be faster than an index scan, and EXPLAIN ANALYZE should tell us if that guess is correct. What version of PostgreSQL are you using? -- Michael Fuhr h

Re: [PERFORM] date - range

2005-04-01 Thread Michael Fuhr
QUERY PLAN Index Scan using foo_date_idx on foo (cost=0.01..15.55 rows=97 width=12) Index Cond: ((first_date <= ('now'::text)::date) AND (last_date >= ('now'::text)::date)) (2 rows) --

Re: [PERFORM] Functionscan estimates

2005-04-08 Thread Michael Fuhr
ts about the expected row count. http://archives.postgresql.org/pgsql-hackers/2005-03/msg00146.php http://archives.postgresql.org/pgsql-hackers/2005-03/msg00153.php -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 9: the pla

Re: [PERFORM] profiling postgresql queries?

2005-04-12 Thread Michael Fuhr
tatistics would be helpful then you could set up a test server and load a copy of your database into it. Just beware that because it's bleeding edge, it might destroy your data and it might behave differently than released versions. -- Michael Fuhr http://www.fuhr.org/~mfuhr/

Re: [PERFORM] Sort and index

2005-04-18 Thread Michael Fuhr
can are both on). But my test case and postgresql.conf settings might be different enough from yours to account for different behavior. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [PERFORM] refcurosr vs. setof

2005-04-18 Thread Michael Fuhr
ill not return until the entire result set has been generatedCurrently, the point at which data begins being written to disk is controlled by the work_mem configuration variable. You might want to test both ways in typical and worst-case scenarios and see how each performs

Re: [PERFORM] index on different types

2005-04-28 Thread Michael Fuhr
it references -- is there a reason for making them different? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED

Re: [PERFORM] timestamp indexing

2005-05-30 Thread Michael Fuhr
How many records are in the tables you're querying? Are you regularly vacuuming and analyzing the database or the individual tables? Are any of the tables clustered? If so, on what indexes and how often are you re-clustering them? What version of PostgreSQL are you using? -- Michael Fuh

Re: [PERFORM] Need help to decide Mysql vs Postgres

2005-06-06 Thread Michael Fuhr
rg/pgsql-committers/2005-04/msg00163.php http://archives.postgresql.org/pgsql-committers/2005-04/msg00168.php -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [PERFORM] Limit clause not using index

2005-06-21 Thread Michael Fuhr
the locks are acquired, no other transaction will be able to access the table or the index until the transaction doing the DROP INDEX commits or rolls back. Rolling back leaves the index in place. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)-

Re: [PERFORM] Performance analysis of plpgsql code

2005-06-27 Thread Michael Fuhr
See timeofday(). http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [PERFORM] Performance analysis of plpgsql code

2005-06-27 Thread Michael Fuhr
On Tue, Jun 28, 2005 at 01:54:08AM +, Karl O. Pinc wrote: > On 06/27/2005 06:33:03 PM, Michael Fuhr wrote: > > >See timeofday(). > > That only gives you the time at the start of the transaction, > so you get no indication of how long anything in the > transaction

Re: [PERFORM] Performance analysis of plpgsql code

2005-06-27 Thread Michael Fuhr
might not be following this thread. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [PERFORM] LIKE search with ending % not optimized in v8

2005-06-28 Thread Michael Fuhr
umed and analyzed your tables? Could you post the EXPLAIN ANALYZE output of a query, once with enable_seqscan turned on and once with it turned off? See also "Operator Classes" in the "Indexes" chapter of the documentation: http://www.postgresql.org/docs/8.0/static/indexes-o

Re: [PERFORM] Postgresql7.4.5 running slow on plpgsql function

2005-06-28 Thread Michael Fuhr
rom the table on each call, leaving a lot of dead tuples? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [PERFORM] Postgresql7.4.5 running slow on plpgsql function

2005-06-29 Thread Michael Fuhr
dead tuples, then how can we solve it? If the function deletes all records from the temporary table then you could use TRUNCATE instead of DELETE. Otherwise you could VACUUM the table between calls to the function (you can't run VACUUM inside a function). -- Michael Fuhr http://ww

Re: [PERFORM] ALTER TABLE tabla ALTER COLUMN columna SET STATISTICS number

2005-07-06 Thread Michael Fuhr
WHERE attstattarget > 0; See the "System Catalogs" chapter in the documentation for more information. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [PERFORM] How to revoke a password

2005-07-08 Thread Michael Fuhr
tication" in the documentation: http://www.postgresql.org/docs/8.0/static/client-authentication.html If you're trying to do something else then please elaborate, as it's not clear what you mean by "I want to ALTER that user to exclude the password." --

Re: [PERFORM] Two queries are better than one?

2005-07-28 Thread Michael Fuhr
s you show are taking fractions of a millisecond; the communications overhead of executing two queries might make that technique significantly slower than just the server execution time that EXPLAIN ANALYZE shows. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ -

Re: [PERFORM] Why hash join instead of nested loop?

2005-08-08 Thread Michael Fuhr
ection_registry_id = 40105) AND (obj1 = 73582)) Total runtime: 0.495 ms (7 rows) -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so tha

Re: [PERFORM] Table locking problems?

2005-08-09 Thread Michael Fuhr
(this will be improved in 8.1). -- Michael Fuhr ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [PERFORM] Speedier count(*)

2005-08-10 Thread Michael Fuhr
MIN and MAX queries. http://archives.postgresql.org/pgsql-committers/2005-04/msg00163.php http://archives.postgresql.org/pgsql-committers/2005-04/msg00168.php -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [PERFORM] difference in plan between 8.0 and 8.1?

2005-08-26 Thread Michael Fuhr
.postgresql.org/docs/postgres/release.html#RELEASE-8-1 You could probably find more detailed discussion in the pgsql-hackers archives. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [PERFORM] Weird performance drop after VACUUM

2005-08-26 Thread Michael Fuhr
TO off; EXPLAIN ANALYZE SELECT ...; SET enable_seqscan TO off; SET enable_indexscan TO on; EXPLAIN ANALYZE SELECT ...; You might also experiment with planner variables like effective_cache_size and random_page_cost to see how changing them affects the query plan. However, be careful of tuning

Re: [PERFORM] Weird performance drop after VACUUM

2005-08-26 Thread Michael Fuhr
ne have? If you have enough memory then raising those variables should result in better plans; you might also want to experiment with random_page_cost. Be careful not to set work_mem/sort_mem too high, though. See "Run-time Configuration" in the "Server Run-time

Re: [PERFORM] Weird performance drop after VACUUM

2005-08-29 Thread Michael Fuhr
? Various tuning guides give advice on how to set the above and other configuration variables. Here's one such guide: http://www.powerpostgresql.com/PerfList/ -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [PERFORM] Massive performance issues

2005-09-01 Thread Michael Fuhr
e_middle could use it, making the indexes on only those columns superfluous. Or am I missing something? -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [PERFORM] Advise about how to delete entries

2005-09-02 Thread Michael Fuhr
quot;EXPLAIN ANALYZE DELETE ..."? Do you vacuum and analyze the tables regularly? What version of PostgreSQL are you using? -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [PERFORM] Improving performance of a query

2005-09-03 Thread Michael Fuhr
dom records into a table and ran the above query. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [PERFORM] CHECK vs REFERENCES

2005-09-09 Thread Michael Fuhr
LECT 1 FROM generate_series(1, 10); INSERT 0 10 Time: 3492.344 ms INSERT INTO test_fk SELECT 1 FROM generate_series(1, 10); INSERT 0 100000 Time: 23578.853 ms -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [PERFORM] CHECK vs REFERENCES

2005-09-10 Thread Michael Fuhr
On Sat, Sep 10, 2005 at 01:03:03AM -0300, Marc G. Fournier wrote: > On Fri, 9 Sep 2005, Michael Fuhr wrote: > >INSERT INTO test_check SELECT 1 FROM generate_series(1, 10); > >INSERT 0 10 > >Time: 3492.344 ms > > > >INSERT INTO test_fk SELECT 1 FROM genera

Re: [PERFORM] Queries 15 times slower on 8.1 beta 2 than on 8.0

2005-09-22 Thread Michael Fuhr
-> Seq Scan on content c (cost=0.00..1.01 rows=1 width=8) (actual time=0.025..0.033 rows=1 loops=1) -> Index Scan using supplier_pkey on supplier s (cost=0.00..3.01 rows=1 width=4) (actual time=0.046..0.053 rows=1 loops=1) Index Cond: ("

Re: [PERFORM] Queries 15 times slower on 8.1 beta 2 than on 8.0

2005-09-22 Thread Michael Fuhr
em; I expect he'll be committing a fix shortly. -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get t

Re: [PERFORM] functions and execution plan caching

2005-10-06 Thread Michael Fuhr
s (this should be done when nobody else is querying the table so the statistics represent only what you did). You can avoid cached plans by using EXECUTE. You'll have to run tests to see whether the potential gain is worth the overhead. -- Michael Fuhr ---(end

Re: [PERFORM] Inefficient escape codes.

2005-10-18 Thread Michael Fuhr
ta in binary, not by automatically converting to and from text. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [PERFORM] Inefficient escape codes.

2005-10-18 Thread Michael Fuhr
pecify whether the data is in text format or binary. See the libpq documentation for details. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [PERFORM] What gets cached?

2005-10-21 Thread Michael Fuhr
projects/pgbuffercache/ Note that pg_buffercache shows only pages in PostgreSQL's buffer cache; it doesn't show your operating system's cache. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archive

Re: [PERFORM] impact of stats_command_string

2005-10-25 Thread Michael Fuhr
n you use COPY, which is much more efficient for bulk loads? http://www.postgresql.org/docs/8.0/interactive/populate.html -- Michael Fuhr ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choo

Re: [PERFORM] Effects of cascading references in foreign keys

2005-10-29 Thread Michael Fuhr
ight explain at least some of the performance improvement. Maybe one of the developers will comment. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [PERFORM] Effects of cascading references in foreign keys

2005-10-29 Thread Michael Fuhr
On Sat, Oct 29, 2005 at 09:49:47AM -0500, Bruno Wolff III wrote: > On Sat, Oct 29, 2005 at 08:24:32 -0600, Michael Fuhr <[EMAIL PROTECTED]> > wrote: > > My tests suggest that a lookup on the referring key is done only > > if the referenced key is changed. Here's an

Re: [PERFORM] Searching union views not using indices

2005-11-04 Thread Michael Fuhr
rsion 8.0.2. I couldn't duplicate this in 8.0.4; I don't know if anything's changed since 8.0.2 that would affect the query plan. Could you post the EXPLAIN ANALYZE output? It might also be useful to see the output with enable_seqscan disabled. Have the tables been vacuumed and analyz

Re: [PERFORM] Perl DBD and an alarming problem

2005-11-16 Thread Michael Fuhr
alled, presumably because it can't do so until the low-level code returns control to Perl. Is there a reason you're using alarm() in the client instead of setting statement_timeout on the server? -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [PERFORM] Perl DBD and an alarming problem

2005-11-17 Thread Michael Fuhr
BI on a per-client basis, > and that works. You probably shouldn't set statement_timeout on a global basis anyway, but did you reload the server after you made the change? Setting statement_timeout in postgresql.conf and then reloading the server works here in 8.0.4. -- Michael Fuhr --

Re: [PERFORM] Perl DBD and an alarming problem

2005-11-17 Thread Michael Fuhr
no effect at all. I tried values clear down to 1 > millisecond, but the server never timed out for any query. Did you use "SHOW statement_timeout" to see if the value was set to what you wanted? Are you sure you edited the right file? As a database superuser execute "SHOW conf

Re: [PERFORM] Stored Procedure

2005-11-22 Thread Michael Fuhr
N NEXT; y := y + 1; z := z + 1; RETURN NEXT; END; $$ LANGUAGE plpgsql IMMUTABLE STRICT; SELECT * FROM fooset(1, 2); y | z + 20 | 10 21 | 11 (2 rows) -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched ou

Re: [PERFORM] Stored Procedure

2005-11-22 Thread Michael Fuhr
t works. Did you try it? If you did and it didn't work then please post exactly what you tried and explain what happened and how that differed from what you'd like. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our lis

Re: [PERFORM] Stored Procedure

2005-11-22 Thread Michael Fuhr
ferring to how I wrote two sets of assignments and RETURN NEXT statements, you don't have to do it that way: you can use a loop, just as you would with any other set-returning function. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [PERFORM] Executing a shell command from a PG function

2005-12-10 Thread Michael Fuhr
cl, PL/Python, etc. There's even a PL/sh: http://pgfoundry.org/projects/plsh/ -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [PERFORM] How much expensive are row level statistics?

2005-12-11 Thread Michael Fuhr
ce for simple selects, but a series of insert/update/delete operations ran about 30% slower when block- and row-level statistics were enabled versus when the statistics collector was disabled. -- Michael Fuhr ---(end of broadcast)--- TIP 9: In ve

Re: [PERFORM] How much expensive are row level statistics?

2005-12-12 Thread Michael Fuhr
t; the hardest if you are doing 1 row at a time operations over a > persistent connection. That's basically how the application I tested works: it receives data from a stream and performs whatever insert/update/delete statements are necessary to update the database for each chunk of dat

Re: [PERFORM] How much expensive are row level statistics?

2005-12-12 Thread Michael Fuhr
On Mon, Dec 12, 2005 at 10:23:42AM -0300, Alvaro Herrera wrote: > Michael Fuhr wrote: > > The cost depends on your usage patterns. I did tests with one of > > my applications and saw no significant performance difference for > > simple selects, but a series of insert/update/

Re: [PERFORM] How much expensive are row level statistics?

2005-12-12 Thread Michael Fuhr
8 stats_command_string = on stats_block_level = on stats_row_level = on time: 2:53.76 [Wanders off, swearing that he ran these tests before and saw higher penalties for block- and row-level statistics.] -- Michael Fuhr ---(end of broadcast)--- TIP 9

Re: [PERFORM] How much expensive are row level statistics?

2005-12-15 Thread Michael Fuhr
amount of time had expired, and then continue processing the query? That way admins could avoid the overhead of posting messages for short-lived queries that nobody's likely to see in pg_stat_activity anyway. -- Michael Fuhr ---(end of broadcast)-

Re: [PERFORM] make bulk deletes faster?

2005-12-18 Thread Michael Fuhr
on the referring columns? Does this table or any referring table have triggers? Also, are you regularly vacuuming and analyzing your tables? Have you examined pg_locks to see if an unacquired lock might be slowing things down? -- Michael Fuhr ---(end of broadcast)--

Re: [PERFORM] Wrong index used when ORDER BY LIMIT 1

2005-12-21 Thread Michael Fuhr
-- workaround 2: quite ugly but seems to work (at least for this > -- one test case): > # explain analyze > select idopont from > (select idopont from muvelet_vonalkod >where muvelet=6859 order by idopont) foo > order by idopont limit 1; Another worka

Re: [PERFORM] Speed of different procedural language

2005-12-21 Thread Michael Fuhr
ng what problem is to be solved it's near impossible to recommend an appropriate tool. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [PERFORM] Speed of different procedural language

2005-12-21 Thread Michael Fuhr
On Wed, Dec 21, 2005 at 10:38:10PM +0100, Steinar H. Gunderson wrote: > On Wed, Dec 21, 2005 at 02:24:42PM -0700, Michael Fuhr wrote: > > The difference is clear only in specific cases; just because you > > saw a 10x increase in some cases doesn't mean you can expect that >

Re: [PERFORM] Speed of different procedural language

2005-12-21 Thread Michael Fuhr
On Thu, Dec 22, 2005 at 02:08:23AM +0100, Steinar H. Gunderson wrote: > On Wed, Dec 21, 2005 at 03:10:28PM -0700, Michael Fuhr wrote: > >> That's funny, my biggest problems with PL/PgSQL have been (among others) > >> exactly with large result sets... > > Out of curi

Re: [PERFORM] Performance problems with 8.1.1 compared to 7.4.7

2005-12-27 Thread Michael Fuhr
your configuration settings the same in both versions? You mentioned increasing work_mem, but what about others like effective_cache_size, random_page_cost, and shared_buffers? -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you che

Re: [PERFORM] Not Picking Index

2007-02-16 Thread Michael Fuhr
ndex? Is there a specific index you want to ignore or do you want the planner to ignore all indexes? What problem are you trying to solve? -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.po

Re: [PERFORM] Execution plan changed after upgrade from 7.3.9 to 8.2.3

2007-03-13 Thread Michael Fuhr
ld you post the query and the complete output of EXPLAIN ANALYZE (preferably without wrapping) for both versions? -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [PERFORM] Determine dead tuples size

2007-03-15 Thread Michael Fuhr
On Thu, Mar 15, 2007 at 01:58:47PM +0600, Alexey Romanchuk wrote: > is it possible to determine dead tuples size for table? See contrib/pgstattuple. -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free s

Re: [PERFORM] Performance of count(*)

2007-03-22 Thread Michael Fuhr
, inserts, updates, and deletes in SQL Server and about the implications on ACID of locking hints such as NOLOCK. Then consider how MVCC handles concurrency without blocking or the need for dirty reads. -- Michael Fuhr ---(end of broadcast)--- TIP 3:

Re: [PERFORM] Nested Loop

2007-03-26 Thread Michael Fuhr
n checklist such as this one: http://www.powerpostgresql.com/PerfList -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [PERFORM] Wrong plan sequential scan instead of an index one

2007-03-30 Thread Michael Fuhr
rget on l_pvcp.value? I ran your queries against canned data in 8.2.3 and better statistics resulted in more accurate row count estimates for this and other parts of the plan. I don't recall if estimates for non-leading-character matches in earlier versions can benefit from better statistics.

Re: [PERFORM] Wrong plan sequential scan instead of an index one

2007-03-30 Thread Michael Fuhr
On Fri, Mar 30, 2007 at 04:46:11AM -0600, Michael Fuhr wrote: > Have you tried increasing the statistics target on l_pvcp.value? > I ran your queries against canned data in 8.2.3 and better statistics > resulted in more accurate row count estimates for this and other > parts of the pl

Re: [PERFORM] postgres 8.2 seems to prefer Seq Scan

2007-04-06 Thread Michael Fuhr
STATISTICS 100; ANALYZE event; You can set the statistics target as high as 1000 to get more accurate results at the cost of longer ANALYZE times. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [PERFORM] Help with TOAST Compression

2007-04-23 Thread Michael Fuhr
I can set the compression settings using the "ALTER TABLE > ALTER SET STORAGE" syntax, but is there a way I can see what this > value is currently set to? You could query pg_attribute.attstorage: http://www.postgresql.org/docs/8.2/interactive/catalog-pg-attribute.html -- Michae

Re: [PERFORM] upgraded to pgsql 8.2.4, getting worse performance then 7.4.x

2007-06-02 Thread Michael Fuhr
ned empirically? How much benefit are they providing and how did you measure that? enable_mergejoin = off geqo = off I've occasionally had to tweak planner settings but I prefer to do so for specific queries instead of changing them server-wide. -- Michael Fuhr -

Re: [PERFORM] pg_statistic doesnt contain details for specific table

2007-06-11 Thread Michael Fuhr
r this table? Is there any chance that somebody set all of the columns' statistics targets to zero? -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [PERFORM] pg_statistic doesnt contain details for specific table

2007-06-11 Thread Michael Fuhr
-1. Negative attstattarget values mean to use the system default, which you can see with: SHOW default_statistics_target; How exactly are you determining that no statistics are showing up for this table? Are you running a query like the following? SELECT * FROM pg_stats WHERE schemaname = 

Re: [PERFORM] Delete Cascade FK speed issue

2007-07-03 Thread Michael Fuhr
) order by n1.nspname, c1.relname, a1.attname; -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [PERFORM] Query Analyser

2007-07-11 Thread Michael Fuhr
default_statistics_target. http://www.postgresql.org/docs/8.2/interactive/sql-altertable.html http://www.postgresql.org/docs/8.2/interactive/runtime-config-query.html#RUNTIME-CONFIG-QUERY-OTHER -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [PERFORM] one column from huge view

2007-07-12 Thread Michael Fuhr
iew, the join is performed even if your query doesn't return any > columns from the outer relation. Also, if the calculation contains > immutable functions, it's not skipped. Don't you mean "if the calculation contains VOLATILE functions, it's not skipped"? --

Re: [PERFORM] Query taking too long. Problem reading explain output.

2007-10-03 Thread Michael Fuhr
mmend disabling sequential scans permanently but doing so can be useful when investigating why the planner thinks one plan will be faster than another. What are your settings for random_page_cost, effective_cache_size, work_mem, and shared_buffers? If you're using the default random_page_cost

Re: [PERFORM] Index isn't used during a join.

2006-01-09 Thread Michael Fuhr
qscan disabled? That'll show whether an index or bitmap scan would be faster. And have you verified that the join condition is correct? Should the query be returning over a million rows? -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [PERFORM] Index isn't used during a join.

2006-01-10 Thread Michael Fuhr
check for the year, or unless you want to match more than one year. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [PERFORM] Index isn't used during a join.

2006-01-11 Thread Michael Fuhr
On Wed, Jan 11, 2006 at 12:56:55AM -0700, Michael Fuhr wrote: > WHERE ... > AND doy >= EXTRACT(doy FROM now() - '24 hour'::interval) > AND doy <= EXTRACT(doy FROM now()) To work on 1 Jan this should be more like WHERE ... AND (doy = EXTRACT(doy FROM now()

Re: [PERFORM] Index isn't used during a join.

2006-01-11 Thread Michael Fuhr
orrection. http://archives.postgresql.org/pgsql-performance/2006-01/msg00104.php -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [PERFORM] Showing Column Statistics Number

2006-01-11 Thread Michael Fuhr
back and see what the > number is for that column? I want to be able to tell which columns I've > changed the statistics on, and which ones I haven't. pg_attribute.attstattarget http://www.postgresql.org/docs/8.1/interactive/catalog-pg-attribute.html -- Michael

Re: [PERFORM] indexes on primary and foreign keys

2006-01-11 Thread Michael Fuhr
ity checks would have to do sequential scans on the referring table (districts). Indeed, performance problems for exactly this reason occasionally come up in the mailing lists. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [PERFORM] indexes on primary and foreign keys

2006-01-11 Thread Michael Fuhr
way to suppress this notice when I create tables in a > >script? > > Set[1] your log_min_messages to WARNING or higher[2]. Or client_min_messages, depending on where you don't want to see the notice. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [PERFORM] insert without oids

2006-01-13 Thread Michael Fuhr
ERT. One complication is how to handle rules that run as part of the insert. http://www.postgresql.org/docs/faqs.TODO.html -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.

Re: [PERFORM] Use of Stored Procedures and

2006-01-18 Thread Michael Fuhr
On Tue, Jan 17, 2006 at 09:04:53AM +, Marcos wrote: > I already read the documentation for to use the SPI_PREPARE and > SPI_EXEC... but sincerely I don't understand how I will use this > resource in my statements. What statements? What problem are you trying to solve? --

Re: [PERFORM] Inconsistant query plan

2006-01-24 Thread Michael Fuhr
ng more tables than that? In another recent thread varying plans were attributed to exceeding geqo_threshold: http://archives.postgresql.org/pgsql-performance/2006-01/msg00132.php Does your situation look similar? -- Michael Fuhr ---(end of broadcast)-

Re: [PERFORM] Incorrect Total runtime Reported by Explain Analyze!?

2006-01-26 Thread Michael Fuhr
IN ANALYZE DELETE FROM foo WHERE id = 1; QUERY PLAN -- Index Scan using foo_pkey on foo (cost=0.00..3.92 rows=1 width=6) (actual time=0.124.

Re: [PERFORM] Sequential scan being used despite indexes

2006-01-31 Thread Michael Fuhr
On Tue, Jan 31, 2006 at 07:29:51PM -0800, Joshua D. Drake wrote: > > Any ideas? > > What does explain analyze say? Also, have the tables been vacuumed and analyzed? -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [PERFORM] Sequential scan being used despite indexes

2006-01-31 Thread Michael Fuhr
un VACUUM ANALYZE on all the tables, then run the query again with EXPLAIN ANALYZE? -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [PERFORM] SQL Function Performance

2006-02-12 Thread Michael Fuhr
, including the numbered parameters ($1, $2, etc.). To execute the query do this: EXPLAIN ANALYZE EXECUTE stmt (...); Where "..." is the same parameter list you'd pass to the function (the same values you used in the direct query). If you need to re-prepare the query then run "DE

Re: [PERFORM] SQL Function Performance

2006-02-13 Thread Michael Fuhr
he first way (parameterized) then the EXPLAIN ANALYZE output would have shown the parameters as $1, $2, $3, etc., which it didn't. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [PERFORM] SQL Function Performance

2006-02-14 Thread Michael Fuhr
xample: CREATE FUNCTION fooquery(qval text) RETURNS SETOF foo AS $$ DECLARE rowfoo%ROWTYPE; query text; BEGIN query := 'SELECT * FROM foo WHERE val = ' || quote_literal(qval); FOR row IN EXECUTE query LOOP RETURN NEXT row; END LOOP; RETURN; END;

Re: [PERFORM] Can anyone explain this pgbench results?

2006-03-06 Thread Michael Fuhr
it coincidence that the "long time" between fast results is about the same? What's your setting? Are your test results more consistent if you execute CHECKPOINT between them? -- Michael Fuhr ---(end of broadcast)--- TIP 1: if post

Re: [PERFORM] Can anyone explain this pgbench results?

2006-03-06 Thread Michael Fuhr
On Mon, Mar 06, 2006 at 07:46:05PM +0100, Joost Kraaijeveld wrote: > Michael Fuhr wrote: > > What's your setting? > > Default. Have you tweaked postgresql.conf at all? If so, what non-default settings are you using? > > Are your test results more consistent >

Re: [PERFORM] Can anyone explain this pgbench results?

2006-03-06 Thread Michael Fuhr
[Please copy the mailing list on replies.] On Mon, Mar 06, 2006 at 09:38:20PM +0100, Joost Kraaijeveld wrote: > Michael Fuhr wrote: > > Have you tweaked postgresql.conf at all? If so, what non-default > > settings are you using? > > Yes, I have tweaked t

Re: [PERFORM] Process Time X200

2006-03-10 Thread Michael Fuhr
mprovements is making the difference. -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly

Re: [PERFORM] Query time

2006-03-10 Thread Michael Fuhr
querying? Might you be hitting geqo_threshold (default 12)? If so then the following thread might be helpful: http://archives.postgresql.org/pgsql-performance/2006-01/msg00132.php -- Michael Fuhr ---(end of broadcast)--- TIP 9: In versions below

Re: [PERFORM] PG Statistics

2006-03-13 Thread Michael Fuhr
test results: http://archives.postgresql.org/pgsql-performance/2005-12/msg00307.php Your results may vary. If you see substantially different results then please post the particulars. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you search

Re: [PERFORM] Help optimizing a slow index scan

2006-03-17 Thread Michael Fuhr
but the rest of the query can be straight out of the SQL and OGC standards. [1] http://www.opengeospatial.org/docs/99-049.pdf [2] http://www.postgis.org/ [3] http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html [4] http://www.oracle.com/technology/products/spatial/index.htm

  1   2   >