pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedSpeed of SQL statements
3+ messages / 2 participants
[nested] [flat]
* Speed of SQL statements
@ 2001-02-18 20:42 Kevin Quinlan <kquinlan@computer.org>
0 siblings, 2 replies; 3+ messages in thread
From: Kevin Quinlan @ 2001-02-18 20:42 UTC (permalink / raw)
To: pgsql-sql
Does anyone have any performance numbers regarding SQL statements,
specifically SELECT, UPDATE, DELETE, and INSERT? For instance, on average
how long does a typical SELECT (UPDATE, DELETE, INSERT) statement take to
execute?
Thank you,
Kevin
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Speed of SQL statements
@ 2001-02-23 14:42 Mathijs Brands <mathijs@ilse.nl>
parent: Kevin Quinlan <kquinlan@computer.org>
1 sibling, 0 replies; 3+ messages in thread
From: Mathijs Brands @ 2001-02-23 14:42 UTC (permalink / raw)
To: Kevin Quinlan <kquinlan@computer.org>; +Cc: pgsql-sql
On Sun, Feb 18, 2001 at 03:42:43PM -0500, Kevin Quinlan allegedly wrote:
> Does anyone have any performance numbers regarding SQL statements,
> specifically SELECT, UPDATE, DELETE, and INSERT? For instance, on average
> how long does a typical SELECT (UPDATE, DELETE, INSERT) statement take to
> execute?
You can use the EXPLAIN command to show the execution plan for a query. This
allows you to tweak your query (and maybe your indexes) for optimal performance.
| iig=# explain select id from entries where not exists (select * from etree where
| siteid = id);
| NOTICE: QUERY PLAN:
|
| Seq Scan on entries (cost=0.00..57838.91 rows=1 width=4)
| SubPlan
| -> Index Scan using idx_etree_siteid on etree (cost=0.00..2.04 rows=1
| width=8)
|
| EXPLAIN
The PostgreSQL documentation has more information on the EXPLAIN command. Make
sure you have a look at the VACUUM command, if you haven't already done so. In
order to come up with an optimal execution plan pgsql needs information about
the contents of your database. This is why you need to run VACUUM ANALYZE from
time to time. It also cleans up your indexes. If pgsql is not using indexes
when you think it should, run a VACUUM ANALYZE on the table and see if that
makes a difference.
I hope this helps,
Mathijs
--
"Books constitute capital."
Thomas Jefferson
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Speed of SQL statements
@ 2001-02-23 14:44 Mathijs Brands <mathijs@ilse.nl>
parent: Kevin Quinlan <kquinlan@computer.org>
1 sibling, 0 replies; 3+ messages in thread
From: Mathijs Brands @ 2001-02-23 14:44 UTC (permalink / raw)
To: Kevin Quinlan <kquinlan@computer.org>; +Cc: pgsql-sql
On Sun, Feb 18, 2001 at 03:42:43PM -0500, Kevin Quinlan allegedly wrote:
> Does anyone have any performance numbers regarding SQL statements,
> specifically SELECT, UPDATE, DELETE, and INSERT? For instance, on average
> how long does a typical SELECT (UPDATE, DELETE, INSERT) statement take to
> execute?
Performance is not easily expressed in time, since it depends a lot on the
way you've setup your database and your queries (indexes, etc). Of course,
the hardware you use also influences the execution time a lot.
Cheers,
Mathijs
--
"It is a great thing to start life with a small number of really good books
which are your very own".
Sir Arthur Conan Doyle (1859-1930)
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2001-02-23 14:44 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-02-18 20:42 Speed of SQL statements Kevin Quinlan <kquinlan@computer.org>
2001-02-23 14:42 ` Mathijs Brands <mathijs@ilse.nl>
2001-02-23 14:44 ` Mathijs Brands <mathijs@ilse.nl>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox