Welcome Guest, Not a member yet? Register   Sign In
Database query question
#11

[eluser]emperius[/eluser]
Wizard,

yes, indexes are on their places
The number of enrties is not big, not more than 200
Tell me please how to change subquery to join, but allowing to choose one photo from ObjectPhoto


Dam1an,

I do not use database class for queries, that's why I think in the results benchmark is displayed in the time of code fulfillment, without queries

is there a way to display the queries?
#12

[eluser]Dam1an[/eluser]
you could use the benchmark class I linked to earlier to set points before and after the query
#13

[eluser]emperius[/eluser]
yes I tried benchmarking class, but are you sure that it shows the time of query execution. I think it shows the time of code output?
#14

[eluser]Dam1an[/eluser]
But if you start a timer just before you do the query and stop it just afterwards, you will have the time between those 2 points (and all you done between those 2 points is execute the query)
#15

[eluser]jedd[/eluser]
Why are we all asking the same questions twice before we get feedback, and why are we concerned about the SQL call within CI - apparently it takes 30s at the commandline - qed the problem is a database one, not a CI one - in turn this means that no matter what faffing you do on the CI side, it's still going to take 30+s to produce the page.
#16

[eluser]Dam1an[/eluser]
[quote author="jedd" date="1246474525"]Why are we all asking the same questions twice before we get feedback, and why are we concerned about the SQL call within CI - apparently it takes 30s at the commandline - qed the problem is a database one, not a CI one - in turn this means that no matter what faffing you do on the CI side, it's still going to take 30+s to produce the page.[/quote]

I'm well aware of that, and I know that putting in those extra bechmarks will not fix the problem, but this way he also learns about the benchmark/profiler classes... that can't be a bad thing Wink
#17

[eluser]TheFuzzy0ne[/eluser]
By enabling the profiler, you can see how long queries take anyway, since they are automatically benchmarked, so I see no real advantage of setting your own benchmarks.

If I were you, I'd go back to basics. Just start at the most simple query, a single row select, and see how fast it is. Then you can start building your query a bit more, and keep testing it until you find the bottleneck.
#18

[eluser]emperius[/eluser]
Jedd,

Code and Application Development
Use the forum to discuss anything related to programming and code development.


this forum not only about CI

if you don't want to help please to not write here

Thank you
#19

[eluser]Dam1an[/eluser]
Does it? Even when you don't use the database class (which according to the quote below he doesn't... although maybe he's just refering to AR)

[quote author="emperius" date="1246467792"]
I do not use database class for queries, that's why I think in the results benchmark is displayed in the time of code fulfillment, without queries[/quote]

Edit: The 'does it' is in response to the Fuzz, not emperius
#20

[eluser]jedd[/eluser]
emperius - I think you've misunderstood the intent of this forum - it's about application development using CodeIgniter.

So far you've answered a small number of the questions I've thrown at you - questions designed to yield answers that will help us help you.

You have confirmed that if you run this SQL query at the CLI it takes 30 seconds - so this is clearly not a CI issue. The problem is with your database. Hence my request that you investigate reducing that SQL query down to its component parts, at the CLI, and also explore the nature of the problem in more detail using the MySQL EXPLAIN command. You can report back the results of your investigation and we can then try to help you further.

Right now it seems to me that you are hoping that by using a different coloured crayon to write the PHP, the database will somehow magically speed up.




Theme © iAndrew 2016 - Forum software by © MyBB