![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is there anything I can do to speed it a bit up? We can assume, that a) inserts are done very rarely and b) the number of actual results are very low |
#3
| |||
| |||
|
|
Nabil Sayegh wrote: [...big snowflake query and explain analyze results...] Is there anything I can do to speed it a bit up? We can assume, that a) inserts are done very rarely and b) the number of actual results are very low One simple idea is to use PREPARE and EXECUTE. This is only useful if you can PREPARE once and then EXECUTE multiple times (i.e. as long as you don't need to reconnect prior to every execution of the query). |

#4
| |||
| |||
|
#5
| |||
| |||
|
|
When I take the query of my first post and EXPLAIN ANALYZE it with 7.3 I get the following output: ---------------------------------------------------------------------------------------------------- Hash Join (cost=85.66..213.16 rows=1 width=240) (actual time=34.01..34.47 rows=1 loops=1) Now I tested it with 7.4 to see if gets faster, but guess what? It's about 40 times slower(!): ---------------------------------------------------------------------------------------------------- Merge Left Join (cost=142.22..142.28 rows=2 width=0) (actual time=18.681..18.684 rows=1 loops=1) |
#6
| |||
| |||
|
|
On Tue, 6 Apr 2004, Nabil Sayegh wrote: When I take the query of my first post and EXPLAIN ANALYZE it with 7.3 I get the following output: ---------------------------------------------------------------------------------------------------- Hash Join (cost=85.66..213.16 rows=1 width=240) (actual time=34.01..34.47 rows=1 loops=1) Now I tested it with 7.4 to see if gets faster, but guess what? It's about 40 times slower(!): ---------------------------------------------------------------------------------------------------- Merge Left Join (cost=142.22..142.28 rows=2 width=0) (actual time=18.681..18.684 rows=1 loops=1) Hmm, this actual time number seems about 1/2 the above unless I'm missing something (34 vs 19). Is it possible you missed some lines or something while posting? |
#7
| |||
| |||
|
|
When I take the query of my first post and EXPLAIN ANALYZE it with 7.3 I get the following output: ---------------------------------------------------------------------------------------------------- Hash Join (cost=85.66..213.16 rows=1 width=240) (actual time=34.01..34.47 rows=1 loops=1) Now I tested it with 7.4 to see if gets faster, but guess what? It's about 40 times slower(!): Merge Left Join (cost=142.22..142.28 rows=2 width=0) (actual time=18.681..18.684 rows=1 loops=1) |
#8
| |||
| |||
|
|
Stephan Szabo wrote: On Tue, 6 Apr 2004, Nabil Sayegh wrote: When I take the query of my first post and EXPLAIN ANALYZE it with 7.3 I get the following output: ---------------------------------------------------------------------------------------------------- Hash Join (cost=85.66..213.16 rows=1 width=240) (actual time=34.01..34.47 rows=1 loops=1) Now I tested it with 7.4 to see if gets faster, but guess what? It's about 40 times slower(!): ---------------------------------------------------------------------------------------------------- Merge Left Join (cost=142.22..142.28 rows=2 width=0) (actual time=18.681..18.684 rows=1 loops=1) Hmm, this actual time number seems about 1/2 the above unless I'm missing something (34 vs 19). Is it possible you missed some lines or something while posting? I posted only the first few lines (it's repeating). |
#9
| |||
| |||
|
|
You're showing actual time of 18 msec vs 34 msec in 7.3, which doesn't work out to 40 times slower on my calculator. If there's a problem here you're not showing it. |
#10
| |||
| |||
|
|
Stephan Szabo wrote: On Tue, 6 Apr 2004, Nabil Sayegh wrote: When I take the query of my first post and EXPLAIN ANALYZE it with 7.3 I get the following output: ---------------------------------------------------------------------------------------------------- Hash Join (cost=85.66..213.16 rows=1 width=240) (actual time=34.01..34.47 rows=1 loops=1) Now I tested it with 7.4 to see if gets faster, but guess what? It's about 40 times slower(!): ---------------------------------------------------------------------------------------------------- Merge Left Join (cost=142.22..142.28 rows=2 width=0) (actual time=18.681..18.684 rows=1 loops=1) Hmm, this actual time number seems about 1/2 the above unless I'm missing something (34 vs 19). Is it possible you missed some lines or something while posting? I posted only the first few lines (it's repeating). |
![]() |
| Thread Tools | |
| Display Modes | |
| |